mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 13:43:51 +08:00
feat: 水印自动包含当前用户名
This commit is contained in:
parent
1b902e65b1
commit
2be10fe044
@ -271,13 +271,6 @@
|
|||||||
<el-switch v-model="getThemeConfig.isWartermark" size="small" @change="onWartermarkChange"></el-switch>
|
<el-switch v-model="getThemeConfig.isWartermark" size="small" @change="onWartermarkChange"></el-switch>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layout-breadcrumb-seting-bar-flex mt14">
|
|
||||||
<div class="layout-breadcrumb-seting-bar-flex-label">{{ $t('layout.fourWartermarkText') }}</div>
|
|
||||||
<div class="layout-breadcrumb-seting-bar-flex-value">
|
|
||||||
<el-input v-model="getThemeConfig.wartermarkText" style="width: 90px" @input="onWartermarkTextInput"></el-input>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 其它设置 -->
|
<!-- 其它设置 -->
|
||||||
<el-divider content-position="left">{{ $t('layout.fiveTitle') }}</el-divider>
|
<el-divider content-position="left">{{ $t('layout.fiveTitle') }}</el-divider>
|
||||||
<div class="layout-breadcrumb-seting-bar-flex mt15">
|
<div class="layout-breadcrumb-seting-bar-flex mt15">
|
||||||
@ -432,6 +425,7 @@ import Watermark from '/@/utils/wartermark';
|
|||||||
import commonFunction from '/@/utils/commonFunction';
|
import commonFunction from '/@/utils/commonFunction';
|
||||||
import other from '/@/utils/other';
|
import other from '/@/utils/other';
|
||||||
import mittBus from '/@/utils/mitt';
|
import mittBus from '/@/utils/mitt';
|
||||||
|
import { useUserInfo } from '/@/stores/userInfo';
|
||||||
|
|
||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
@ -555,16 +549,11 @@ const onAddDarkChange = () => {
|
|||||||
};
|
};
|
||||||
// 4、界面显示 --> 开启水印
|
// 4、界面显示 --> 开启水印
|
||||||
const onWartermarkChange = () => {
|
const onWartermarkChange = () => {
|
||||||
getThemeConfig.value.isWartermark ? Watermark.set(getThemeConfig.value.wartermarkText) : Watermark.del();
|
const username = useUserInfo().userInfos.user.username;
|
||||||
setLocalThemeConfig();
|
getThemeConfig.value.isWartermark ? Watermark.set(username) : Watermark.del();
|
||||||
};
|
|
||||||
// 4、界面显示 --> 水印文案
|
|
||||||
const onWartermarkTextInput = (val: string) => {
|
|
||||||
getThemeConfig.value.wartermarkText = verifyAndSpace(val);
|
|
||||||
if (getThemeConfig.value.wartermarkText === '') return false;
|
|
||||||
if (getThemeConfig.value.isWartermark) Watermark.set(getThemeConfig.value.wartermarkText);
|
|
||||||
setLocalThemeConfig();
|
setLocalThemeConfig();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 5、布局切换
|
// 5、布局切换
|
||||||
const onSetLayout = (layout: string) => {
|
const onSetLayout = (layout: string) => {
|
||||||
Local.set('oldLayout', layout);
|
Local.set('oldLayout', layout);
|
||||||
|
Loading…
Reference in New Issue
Block a user