|
@@ -14,7 +14,7 @@ import {
|
|
|
Notification,
|
|
Notification,
|
|
|
UserDropdown,
|
|
UserDropdown,
|
|
|
} from '@vben/layouts';
|
|
} from '@vben/layouts';
|
|
|
-import { preferences } from '@vben/preferences';
|
|
|
|
|
|
|
+import { preferences, usePreferences } from '@vben/preferences';
|
|
|
import { useAccessStore, useTabbarStore, useUserStore } from '@vben/stores';
|
|
import { useAccessStore, useTabbarStore, useUserStore } from '@vben/stores';
|
|
|
import { openWindow } from '@vben/utils';
|
|
import { openWindow } from '@vben/utils';
|
|
|
|
|
|
|
@@ -93,6 +93,7 @@ const userStore = useUserStore();
|
|
|
const authStore = useAuthStore();
|
|
const authStore = useAuthStore();
|
|
|
const accessStore = useAccessStore();
|
|
const accessStore = useAccessStore();
|
|
|
const { destroyWatermark, updateWatermark } = useWatermark();
|
|
const { destroyWatermark, updateWatermark } = useWatermark();
|
|
|
|
|
+const { isDark } = usePreferences();
|
|
|
const showDot = computed(() =>
|
|
const showDot = computed(() =>
|
|
|
notifications.value.some((item) => !item.isRead),
|
|
notifications.value.some((item) => !item.isRead),
|
|
|
);
|
|
);
|
|
@@ -194,10 +195,28 @@ watch(
|
|
|
() => ({
|
|
() => ({
|
|
|
enable: preferences.app.watermark,
|
|
enable: preferences.app.watermark,
|
|
|
content: preferences.app.watermarkContent,
|
|
content: preferences.app.watermarkContent,
|
|
|
|
|
+ isDark: isDark.value,
|
|
|
}),
|
|
}),
|
|
|
- async ({ enable, content }) => {
|
|
|
|
|
|
|
+ async ({ enable, content, isDark: isDarkValue }) => {
|
|
|
if (enable) {
|
|
if (enable) {
|
|
|
|
|
+ const watermarkColor = isDarkValue
|
|
|
|
|
+ ? 'rgba(255, 255, 255, 0.12)'
|
|
|
|
|
+ : 'rgba(0, 0, 0, 0.12)';
|
|
|
|
|
+
|
|
|
await updateWatermark({
|
|
await updateWatermark({
|
|
|
|
|
+ advancedStyle: {
|
|
|
|
|
+ colorStops: [
|
|
|
|
|
+ {
|
|
|
|
|
+ color: watermarkColor,
|
|
|
|
|
+ offset: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ color: watermarkColor,
|
|
|
|
|
+ offset: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ type: 'linear',
|
|
|
|
|
+ },
|
|
|
content:
|
|
content:
|
|
|
content ||
|
|
content ||
|
|
|
`${userStore.userInfo?.username} - ${userStore.userInfo?.realName}`,
|
|
`${userStore.userInfo?.username} - ${userStore.userInfo?.realName}`,
|