fix: 修复外观设置bug

This commit is contained in:
wangdan-fit2cloud 2024-07-16 18:50:44 +08:00
parent 62bc32aa9c
commit 7fd19356b5
2 changed files with 4 additions and 5 deletions

View File

@ -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()
})
},

View File

@ -131,7 +131,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, computed, watch } from 'vue'
import { ref, reactive, onMounted, computed, watch, nextTick } from 'vue'
import { onBeforeRouteLeave } from 'vue-router'
import type { FormInstance, FormRules, UploadFiles } from 'element-plus'
import { cloneDeep } from 'lodash'