!89 修改水印更新通知发起时机

Merge pull request !89 from wen/dev
This commit is contained in:
lengleng 2024-08-26 03:24:21 +00:00 committed by Gitee
commit e98e24eba2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 9 additions and 10 deletions

View File

@ -58,10 +58,6 @@ onMounted(() => {
mittBus.on('openSetingsDrawer', () => { mittBus.on('openSetingsDrawer', () => {
settingRef.value.openDrawer(); settingRef.value.openDrawer();
}); });
//
mittBus.on('updateWartermark', () => {
settingRef.value.onWartermarkChange();
});
// //
if (Local.get('themeConfig')) { if (Local.get('themeConfig')) {
storesThemeConfig.setThemeConfig({ themeConfig: Local.get('themeConfig') }); storesThemeConfig.setThemeConfig({ themeConfig: Local.get('themeConfig') });
@ -73,10 +69,9 @@ onMounted(() => {
} }
}); });
}); });
// /i18n/ // /i18n
onUnmounted(() => { onUnmounted(() => {
mittBus.off('openSetingsDrawer', () => {}); mittBus.off('openSetingsDrawer', () => {});
mittBus.off('updateWartermark', () => {});
}); });
// //
watch( watch(

View File

@ -653,6 +653,10 @@ onMounted(() => {
initLayoutChangeFun(); initLayoutChangeFun();
state.isMobile = other.isMobile(); state.isMobile = other.isMobile();
}); });
//
mittBus.on('updateWartermark', () => {
onWartermarkChange();
});
setTimeout(() => { setTimeout(() => {
// //
onColorPickerChange(); onColorPickerChange();
@ -673,12 +677,12 @@ onMounted(() => {
}); });
onUnmounted(() => { onUnmounted(() => {
mittBus.off('layoutMobileResize', () => {}); mittBus.off('layoutMobileResize', () => {});
mittBus.off('updateWartermark', () => {});
}); });
// //
defineExpose({ defineExpose({
openDrawer, openDrawer,
onWartermarkChange,
}); });
</script> </script>

View File

@ -3,6 +3,7 @@ import { Session } from '/@/utils/storage';
import { getUserInfo, login, loginByMobile, loginBySocial, refreshTokenApi } from '/@/api/login/index'; import { getUserInfo, login, loginByMobile, loginBySocial, refreshTokenApi } from '/@/api/login/index';
import other from '/@/utils/other'; import other from '/@/utils/other';
import { useMessage } from '/@/hooks/message'; import { useMessage } from '/@/hooks/message';
import mittBus from '/@/utils/mitt';
/** /**
* @function useUserInfo * @function useUserInfo
@ -130,6 +131,8 @@ export const useUserInfo = defineStore('userInfo', {
authBtnList: res.data.permissions, authBtnList: res.data.permissions,
}; };
this.userInfos = userInfo; this.userInfos = userInfo;
// 重新加载水印
mittBus.emit('updateWartermark');
}); });
}, },
}, },

View File

@ -40,7 +40,6 @@ import { formatAxis } from '/@/utils/formatTime';
import { useMessage } from '/@/hooks/message'; import { useMessage } from '/@/hooks/message';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
import { initBackEndControlRoutes } from '/@/router/backEnd'; import { initBackEndControlRoutes } from '/@/router/backEnd';
import mittBus from '/@/utils/mitt';
// //
const Password = defineAsyncComponent(() => import('./component/password.vue')); const Password = defineAsyncComponent(() => import('./component/password.vue'));
@ -72,8 +71,6 @@ const signInSuccess = async () => {
useMessage().wraning('抱歉,您没有登录权限'); useMessage().wraning('抱歉,您没有登录权限');
Session.clear(); Session.clear();
} else { } else {
//
mittBus.emit('updateWartermark');
// //
let currentTimeInfo = formatAxis(new Date()); let currentTimeInfo = formatAxis(new Date());
if (route.query?.redirect) { if (route.query?.redirect) {