diff --git a/ui/src/views/theme/index.vue b/ui/src/views/theme/index.vue index bce4d103a..621d89664 100644 --- a/ui/src/views/theme/index.vue +++ b/ui/src/views/theme/index.vue @@ -6,14 +6,19 @@
平台显示主题
+ +
+
平台显示主题
+ +
平台登陆设置
@@ -168,6 +173,8 @@ const themeForm = ref({ title: 'MaxKB', slogan: '欢迎使用 MaxKB 智能知识库' }) +const themeRadio = ref('') +const customColor = ref('') const rules = reactive({ title: [{ required: true, message: '请输入网站标题', trigger: 'blur' }], @@ -197,6 +204,12 @@ const onChange = (file: any, fileList: UploadFiles, attr: string) => { } function changeThemeHandle(val: string) { + if (val !== 'custom') { + themeForm.value.theme = val + user.setTheme(themeForm.value) + } +} +function customColorHandle(val: string) { themeForm.value.theme = val user.setTheme(themeForm.value) } @@ -236,6 +249,10 @@ onMounted(() => { router.push({ path: `/application` }) } if (themeInfo.value) { + themeRadio.value = themeList.some((v) => v === themeInfo.value.theme) + ? themeInfo.value.theme + : 'custom' + customColor.value = themeInfo.value.theme themeForm.value = themeInfo.value cloneTheme.value = cloneDeep(themeInfo.value) }