diff --git a/src/router/index.js b/src/router/index.js index dc4e1a9..1837141 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -104,23 +104,25 @@ router.beforeEach(async(to, from, next) => { // afterEach Router router.afterEach((to) => { const store = useUserStore(); - - // 修改网页标题 - if (to.name !== 'login') { - document.title = `${to.meta.title} - ${store.sysConfig.sys_app_name}`; - } else { - document.title = store.sysConfig.sys_app_name; - } - - // Vincent 2023004 修复加载水印的bug - if (store.userInfo != undefined){ - if ( store.userInfo.name != undefined ) { - Watermark.set(store.userInfo.name) + // Vincent 2023004 修复加载水印的bug + if (store.userInfo != undefined){ + if ( store.userInfo.nick_name != undefined ) { + Watermark.set(store.userInfo.nick_name) } else { Watermark.out() // 清除水印 } } else{ Watermark.out() // 清除水印 } + + // 修改网页标题 + if (to.name !== 'login') { + document.title = `${to.meta.title} - ${store.sysConfig.sys_app_name}`; + } else { + document.title = store.sysConfig.sys_app_name; + Watermark.out() + } + + }); export default router; diff --git a/src/store/userInfo.js b/src/store/userInfo.js index 07e31da..5610cc2 100644 --- a/src/store/userInfo.js +++ b/src/store/userInfo.js @@ -2,8 +2,8 @@ import { defineStore } from 'pinia'; import { setLocalStorage, getLocalStorage } from '@/utils/storage'; import {logout} from '@/api/admin/login' import { usePermissionStore } from '@/store/permission'; -import { getInfo } from '@/api/admin/sys-user'; -import { getAppConfig } from '@/api/admin/login'; +// import { getInfo } from '@/api/admin/sys-user'; +// import { getAppConfig } from '@/api/admin/login'; export const useUserStore = defineStore('user', { state: () => { @@ -47,7 +47,7 @@ export const useUserStore = defineStore('user', { if(code==200){ this.clearInfo(); - window.location.href="/login" + window.location.href="/login"; } } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 9fa7b3d..8a3aae5 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -13,7 +13,7 @@