二次开发:补全 PRO 功能 + 优化体验

- 新增站点自定义(标题/Favicon/登录页描述)
- 新增在线自定义 CSS/JS 编辑器
- 扩展备份迁移支持面板配置导出导入
- 默认账号改为 admin/1234
- 设置按钮改为橙色更醒目
- 修复登录页误报"登录过期"弹窗
- 修复 i18n 双重 apps 块导致翻译失效

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
yuming
2026-05-15 14:29:03 +08:00
parent 25f46209d9
commit d6daf1dce6
24 changed files with 587 additions and 46 deletions
+29 -3
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { NButton, NCard, NForm, NFormItem, NGradientText, NInput, NSelect, useMessage } from 'naive-ui'
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import { login } from '@/api'
import { useAppStore, useAuthStore } from '@/store'
import { SvgIcon } from '@/components/common'
@@ -8,14 +8,37 @@ import { router } from '@/router'
import { t } from '@/locales'
import { languageOptions } from '@/utils/defaultData'
import type { Language } from '@/store/modules/app/helper'
import { getSiteCustomize } from '@/api/system/siteCustomize'
import type { SiteCustomize } from '@/api/system/siteCustomize'
// const userStore = useUserStore()
const authStore = useAuthStore()
const appStore = useAppStore()
const ms = useMessage()
const loading = ref(false)
const languageValue = ref<Language>(appStore.language)
const siteCustomize = ref<SiteCustomize>({
siteTitle: '',
faviconUrl: '',
loginDescription: '',
})
onMounted(async () => {
try {
const res = await getSiteCustomize<SiteCustomize>()
if (res.code === 0 && res.data) {
siteCustomize.value = res.data
// 动态设置 favicon
if (res.data.faviconUrl) {
const link = document.querySelector<HTMLLinkElement>('link[rel~="icon"]')
if (link)
link.href = res.data.faviconUrl
}
}
}
catch {}
})
// const isShowCaptcha = ref<boolean>(false)
// const isShowRegister = ref<boolean>(false)
@@ -75,9 +98,12 @@ function handleChangeLanuage(value: Language) {
<div class="login-title ">
<NGradientText :size="30" type="success" class="!font-bold">
{{ $t('common.appName') }}
{{ siteCustomize.siteTitle || $t('common.appName') }}
</NGradientText>
</div>
<div v-if="siteCustomize.loginDescription" class="text-center text-slate-400 text-sm mb-3">
{{ siteCustomize.loginDescription }}
</div>
<NForm :model="form" label-width="100px" @keydown.enter="handleSubmit">
<NFormItem>
<NInput v-model:value="form.username" :placeholder="$t('login.usernamePlaceholder')">