feat: 新增全局水印配置

支持开启全局水印,支持设置水印信息(不设置则默认显示昵称+用户名)
This commit is contained in:
KAI
2024-09-26 02:13:13 +00:00
committed by Charles7c
parent e2fe1ab814
commit 8d8d79e568
3 changed files with 31 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@@ -57,6 +57,12 @@
<a-descriptions-item label="版权显示">
<a-switch v-model="appStore.copyrightDisplay" />
</a-descriptions-item>
<a-descriptions-item label="水印">
<a-switch v-model="appStore.isOpenWatermark" />
</a-descriptions-item>
<a-descriptions-item v-if="appStore.isOpenWatermark" label="水印信息">
<a-input v-model="appStore.watermark" placeholder="留空则显示用户名" />
</a-descriptions-item>
</a-descriptions>
</a-space>
</a-drawer>
@@ -66,10 +72,11 @@
import { ColorPicker } from 'vue-color-kit'
import 'vue-color-kit/dist/vue-color-kit.css'
import LayoutItem from './components/LayoutItem.vue'
import { useAppStore } from '@/stores'
import { useAppStore, useUserStore } from '@/stores'
defineOptions({ name: 'SettingDrawer' })
const appStore = useAppStore()
const userStore = useUserStore()
const visible = ref(false)
const tabModeList: App.TabItem[] = [
@@ -90,6 +97,7 @@ const open = () => {
visible.value = true
}
const waterMarkPlaceholder = ref<string>()
defineExpose({ open })
// 默认显示的主题色列表

2
src/types/app.d.ts vendored
View File

@@ -12,6 +12,8 @@ declare namespace App {
copyrightDisplay: boolean // 是否显示底部版权信息
menuDark: boolean // 菜单深色模式
layout: 'left' | 'mix'
isOpenWatermark: boolean // 是否开启水印
watermark: string // 水印
}
/** 导航页签的样式类型 */
type TabType = 'card' | 'card-gutter' | 'rounded'