From e3b9db68479fe3b9d6357bf77dfe9d339da1661a Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Tue, 16 Jul 2024 18:50:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=96=E8=A7=82?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/stores/modules/user.ts | 7 +++---- ui/src/views/theme/index.vue | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/src/stores/modules/user.ts b/ui/src/stores/modules/user.ts index cbe6e208a..21db8d6c3 100644 --- a/ui/src/stores/modules/user.ts +++ b/ui/src/stores/modules/user.ts @@ -92,8 +92,7 @@ const useUserStore = defineStore({ async theme() { return await ThemeApi.getThemeInfo().then((ok) => { - this.themeInfo = ok.data - changeTheme(this.themeInfo['theme']) + this.setTheme(ok.data) window.document.title = this.themeInfo['title'] || 'MaxKB' const link = document.querySelector('link[rel="icon"]') as any if (link) { @@ -103,9 +102,9 @@ const useUserStore = defineStore({ }, async profile() { - return UserApi.profile().then((ok) => { + return UserApi.profile().then(async (ok) => { this.userInfo = ok.data - this.theme() + await this.theme() return this.asyncGetProfile() }) }, diff --git a/ui/src/views/theme/index.vue b/ui/src/views/theme/index.vue index f7d9cac3d..d383179fa 100644 --- a/ui/src/views/theme/index.vue +++ b/ui/src/views/theme/index.vue @@ -131,7 +131,7 @@