加水印

This commit is contained in:
zoujiandong 2023-10-26 09:08:10 +08:00
parent ea9113a98a
commit b82466f17d
3 changed files with 18 additions and 16 deletions

View File

@ -104,23 +104,25 @@ router.beforeEach(async(to, from, next) => {
// afterEach Router // afterEach Router
router.afterEach((to) => { router.afterEach((to) => {
const store = useUserStore(); const store = useUserStore();
// Vincent 2023004 修复加载水印的bug
// 修改网页标题 if (store.userInfo != undefined){
if (to.name !== 'login') { if ( store.userInfo.nick_name != undefined ) {
document.title = `${to.meta.title} - ${store.sysConfig.sys_app_name}`; Watermark.set(store.userInfo.nick_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)
} else { } else {
Watermark.out() // 清除水印 Watermark.out() // 清除水印
} }
} else{ } else{
Watermark.out() // 清除水印 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; export default router;

View File

@ -2,8 +2,8 @@ import { defineStore } from 'pinia';
import { setLocalStorage, getLocalStorage } from '@/utils/storage'; import { setLocalStorage, getLocalStorage } from '@/utils/storage';
import {logout} from '@/api/admin/login' import {logout} from '@/api/admin/login'
import { usePermissionStore } from '@/store/permission'; import { usePermissionStore } from '@/store/permission';
import { getInfo } from '@/api/admin/sys-user'; // import { getInfo } from '@/api/admin/sys-user';
import { getAppConfig } from '@/api/admin/login'; // import { getAppConfig } from '@/api/admin/login';
export const useUserStore = defineStore('user', { export const useUserStore = defineStore('user', {
state: () => { state: () => {
@ -47,7 +47,7 @@ export const useUserStore = defineStore('user', {
if(code==200){ if(code==200){
this.clearInfo(); this.clearInfo();
window.location.href="/login" window.location.href="/login";
} }
} }

View File

@ -13,7 +13,7 @@
<div class="login-form-container"> <div class="login-form-container">
<div class="account-top"> <div class="account-top">
<div class="account-top-logo"> <div class="account-top-logo">
<img :src="store.sysConfig.sys_app_logo" /> <img src="../../icons/logo.png" />
<span class="project-title">用户登录</span> <span class="project-title">用户登录</span>
</div> </div>
<div class="account-top-desc">肝胆相照 健康中国</div> <div class="account-top-desc">肝胆相照 健康中国</div>