Commit 6bde4791 authored by 刘雅文's avatar 刘雅文

水印新增日期

parent f3bb62fe
......@@ -10,17 +10,25 @@ import vueCanvasNest from "vue-canvas-nest";
//引入水印插件
// import watermark from "watermark-dom";
import watermark from './utils/watermark'
import watermark from "./utils/watermark";
export default {
name: "app",
components: { vueCanvasNest },
created() {
const loginName = localStorage.getItem("loginName");
const userCell = localStorage.getItem("userCellFour");
// const userCells = userCell.substr(-4);
const nowDate = new Date();
const nowMonth = nowDate.getMonth() + 1;
const nowDay = nowDate.getDate()>10?nowDate.getDate():'0'+nowDate.getDate();
// console.log(nowTime,'当前时间');
setTimeout(() => {
if (loginName) {
watermark.load({ watermark_txt: loginName + userCell ,watermark_color:'#aaa',watermark_angle:30,watermark_width:200,});
watermark.load({
watermark_txt: loginName + userCell+nowMonth+nowDay,
watermark_color: "#aaa",
watermark_angle: 30,
watermark_width: 400,
});
}
}, 100);
},
......
......@@ -67,7 +67,7 @@
<script type="text/ecmascript-6">
// import watermark from "watermark-dom";
import watermark from '../../utils/watermark'
import watermark from "../../utils/watermark";
export default {
name: "SisLogin",
......@@ -125,7 +125,6 @@ export default {
this.$cacheUtils.cleanCache();
this.$$post("/login", this.user).then((res) => {
if (res.data.code === "200") {
// console.log(res.data.result,'登录成功返回的结果');
localStorage.setItem("userName", res.data.result.userName);
localStorage.setItem("agentNo", res.data.result.extensionNumber);
......@@ -145,7 +144,7 @@ export default {
localStorage.setItem("btnPermission", btnPermission);
if (res.data.result.buttonList != []) {
localStorage.setItem("btnUrl", res.data.result.buttonList);
}else{
} else {
localStorage.setItem("btnUrl", null);
}
localStorage.setItem(
......@@ -168,9 +167,23 @@ export default {
localStorage.setItem("bg", context.canvas.toDataURL());
this.$router.push("/index");
setTimeout(()=>{
watermark.load({ watermark_txt: res.data.result.loginName + res.data.result.userCellFour ,watermark_color:'#aaa',watermark_angle:30,watermark_width:300,});
},100)
const nowDate = new Date();
const nowMonth = nowDate.getMonth() + 1;
const nowDay =
nowDate.getDate() > 10
? nowDate.getDate()
: "0" + nowDate.getDate();
setTimeout(() => {
watermark.load({
watermark_txt:
res.data.result.loginName +
res.data.result.userCellFour +
nowMonth+nowDay,
watermark_color: "#aaa",
watermark_angle: 30,
watermark_width: 400,
});
}, 100);
} else {
this.ui.loginLoading = false;
this.$message({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment