diff --git a/src/App.vue b/src/App.vue index e617af50..014a6428 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,6 +4,7 @@ import { NConfigProvider, darkTheme } from 'naive-ui'; import type { WatermarkProps } from 'naive-ui'; import { useAppStore } from './store/modules/app'; import { useThemeStore } from './store/modules/theme'; +import { useAuthStore } from './store/modules/auth'; import { naiveDateLocales, naiveLocales } from './locales/naive'; defineOptions({ @@ -12,6 +13,7 @@ defineOptions({ const appStore = useAppStore(); const themeStore = useThemeStore(); +const authStore = useAuthStore(); const naiveDarkTheme = computed(() => (themeStore.darkMode ? darkTheme : undefined)); @@ -24,8 +26,13 @@ const naiveDateLocale = computed(() => { }); const watermarkProps = computed(() => { + const content = + themeStore.watermark.enableUserName && authStore.userInfo.userName + ? authStore.userInfo.userName + : themeStore.watermark.text; + return { - content: themeStore.watermark.text, + content, cross: true, fullscreen: true, fontSize: 16, diff --git a/src/layouts/modules/theme-drawer/modules/page-fun.vue b/src/layouts/modules/theme-drawer/modules/page-fun.vue index aa0aadab..0b00f2bd 100644 --- a/src/layouts/modules/theme-drawer/modules/page-fun.vue +++ b/src/layouts/modules/theme-drawer/modules/page-fun.vue @@ -117,7 +117,10 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra - + + + +