Skip to content

Commit 89552f8

Browse files
author
Kerwin
committed
fix: 手机版样式 (Close Chanzhaoyu#227)
1 parent 43f553c commit 89552f8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/components/common/Setting/Keys.vue

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import { KeyConfig, Status, UserRole, apiModelOptions, userRoleOptions } from '.
66
import { fetchGetKeys, fetchUpdateApiKeyStatus, fetchUpsertApiKey } from '@/api'
77
import { t } from '@/locales'
88
import { useAuthStore } from '@/store'
9+
import { useBasicLayout } from '@/hooks/useBasicLayout'
910
1011
const ms = useMessage()
1112
const dialog = useDialog()
1213
const authStore = useAuthStore()
14+
const { isMobile } = useBasicLayout()
15+
1316
const loading = ref(false)
1417
const show = ref(false)
1518
const handleSaving = ref(false)
@@ -227,20 +230,20 @@ onMounted(async () => {
227230
</div>
228231
</div>
229232

230-
<NModal v-model:show="show" :auto-focus="false" preset="card" style="width:50%;">
233+
<NModal v-model:show="show" :auto-focus="false" preset="card" :style="{ width: !isMobile ? '50%' : '100%' }">
231234
<div class="p-4 space-y-5 min-h-[200px]">
232235
<div class="space-y-6">
233236
<div class="flex items-center space-x-4">
234237
<span class="flex-shrink-0 w-[100px]">{{ $t('setting.apiModel') }}</span>
235-
<div>
238+
<div class="flex-1">
236239
<NSelect
237-
style="width: 240px"
240+
style="width: 100%"
238241
:value="keyConfig.keyModel"
239242
:options="apiModelOptions"
240243
@update-value="value => keyConfig.keyModel = value"
241244
/>
242245
</div>
243-
<p>
246+
<p v-if="!isMobile">
244247
<a v-if="keyConfig.keyModel === 'ChatGPTAPI'" target="_blank" href="https://platform.openai.com/account/api-keys">Get Api Key</a>
245248
<a v-else target="_blank" href="https://chat.openai.com/api/auth/session">Get Access Token</a>
246249
</p>

src/components/common/Setting/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const show = computed({
4545
</script>
4646

4747
<template>
48-
<NModal v-model:show="show" :auto-focus="false" preset="card" :style="{ 'width': '80%', 'min-height': !isMobile ? '800px' : 'auto' }">
48+
<NModal v-model:show="show" :auto-focus="false" preset="card" :style="{ 'width': !isMobile ? '80%' : '100%', 'min-height': !isMobile ? '800px' : 'auto' }">
4949
<div>
5050
<NTabs v-model:value="active" type="line" animated>
5151
<NTabPane name="General" tab="General">

0 commit comments

Comments
 (0)