Commit 245d24b2 authored by 刘雅文's avatar 刘雅文

添加水印

parent 6826c807
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"vuedraggable": "^2.21.0", "vuedraggable": "^2.21.0",
"vuex": "^3.0.1", "vuex": "^3.0.1",
"vuex-persistedstate": "^2.5.4", "vuex-persistedstate": "^2.5.4",
"watermark-dom": "^2.3.0" "watermark-dom": "^2.2.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.4.0", "@vue/cli-plugin-babel": "~4.4.0",
...@@ -12725,9 +12725,9 @@ ...@@ -12725,9 +12725,9 @@
} }
}, },
"node_modules/watermark-dom": { "node_modules/watermark-dom": {
"version": "2.3.0", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/watermark-dom/-/watermark-dom-2.3.0.tgz", "resolved": "https://registry.npmjs.org/watermark-dom/-/watermark-dom-2.2.1.tgz",
"integrity": "sha512-2++fJESs8ULlrOPHEJGi72UxcDmVTsJDZ3kMa5umU6IWc78A4g1kOAqh1k6FEQhrq9QpkV7wzuoUeMhvFlWGWg==" "integrity": "sha512-mHmp+g4sBjvQ6Ew/WCfNfJoxwIAA7FGbUKfd34eJIzOG9Gmlpg+v7A3hykt2JbiU4/ve+K+OCPvQlKiA2wJqew=="
}, },
"node_modules/wbuf": { "node_modules/wbuf": {
"version": "1.7.3", "version": "1.7.3",
...@@ -24171,9 +24171,9 @@ ...@@ -24171,9 +24171,9 @@
} }
}, },
"watermark-dom": { "watermark-dom": {
"version": "2.3.0", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/watermark-dom/-/watermark-dom-2.3.0.tgz", "resolved": "https://registry.npmjs.org/watermark-dom/-/watermark-dom-2.2.1.tgz",
"integrity": "sha512-2++fJESs8ULlrOPHEJGi72UxcDmVTsJDZ3kMa5umU6IWc78A4g1kOAqh1k6FEQhrq9QpkV7wzuoUeMhvFlWGWg==" "integrity": "sha512-mHmp+g4sBjvQ6Ew/WCfNfJoxwIAA7FGbUKfd34eJIzOG9Gmlpg+v7A3hykt2JbiU4/ve+K+OCPvQlKiA2wJqew=="
}, },
"wbuf": { "wbuf": {
"version": "1.7.3", "version": "1.7.3",
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
"vuedraggable": "^2.21.0", "vuedraggable": "^2.21.0",
"vuex": "^3.0.1", "vuex": "^3.0.1",
"vuex-persistedstate": "^2.5.4", "vuex-persistedstate": "^2.5.4",
"watermark-dom": "^2.3.0" "watermark-dom": "^2.2.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.4.0", "@vue/cli-plugin-babel": "~4.4.0",
......
...@@ -9,17 +9,18 @@ import vueCanvasNest from "vue-canvas-nest"; ...@@ -9,17 +9,18 @@ import vueCanvasNest from "vue-canvas-nest";
// npm install watermark-dom --save 安装水印插件 // npm install watermark-dom --save 安装水印插件
//引入水印插件 //引入水印插件
import watermark from "watermark-dom"; // import watermark from "watermark-dom";
import watermark from './watermark-dom/watermark'
export default { export default {
name: "app", name: "app",
components: { vueCanvasNest }, components: { vueCanvasNest },
created() { created() {
const userName = localStorage.getItem("userName"); const userName = localStorage.getItem("userName");
const userCell = localStorage.getItem("userCell"); const userCell = localStorage.getItem("userCellFour");
const userCells = userCell.substr(-4); // const userCells = userCell.substr(-4);
setTimeout(() => { setTimeout(() => {
if (userName) { if (userName) {
watermark.load({ watermark_txt: userName + userCells ,watermark_color:'#aaa',watermark_angle:30,}); watermark.load({ watermark_txt: userName + userCell ,watermark_color:'#aaa',watermark_angle:30});
} }
}, 100); }, 100);
}, },
......
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import watermark from "watermark-dom"; // import watermark from "watermark-dom";
import watermark from '../../watermark-dom/watermark'
export default { export default {
name: "SisLogin", name: "SisLogin",
...@@ -124,12 +125,13 @@ export default { ...@@ -124,12 +125,13 @@ export default {
this.$cacheUtils.cleanCache(); this.$cacheUtils.cleanCache();
this.$$post("/login", this.user).then((res) => { this.$$post("/login", this.user).then((res) => {
if (res.data.code === "200") { if (res.data.code === "200") {
watermark.load({ watermark_txt: res.data.result.userName + res.data.result.userCell.substr(-4) ,watermark_color:'#aaa',watermark_angle:30,});
// console.log(res.data.result,'登录成功返回的结果'); // console.log(res.data.result,'登录成功返回的结果');
localStorage.setItem("userName", res.data.result.userName); localStorage.setItem("userName", res.data.result.userName);
localStorage.setItem("agentNo", res.data.result.extensionNumber); localStorage.setItem("agentNo", res.data.result.extensionNumber);
localStorage.setItem("loginName", res.data.result.loginName); localStorage.setItem("loginName", res.data.result.loginName);
localStorage.setItem("userCell", res.data.result.userCell); localStorage.setItem("userCell", res.data.result.userCell);
localStorage.setItem("userCellFour", res.data.result.userCellFour);
// console.log(res.data.result.userCell,'返回的手机号'); // console.log(res.data.result.userCell,'返回的手机号');
let userRolePermission = this.userRolelistToStringUtils( let userRolePermission = this.userRolelistToStringUtils(
...@@ -166,6 +168,9 @@ export default { ...@@ -166,6 +168,9 @@ export default {
localStorage.setItem("bg", context.canvas.toDataURL()); localStorage.setItem("bg", context.canvas.toDataURL());
this.$router.push("/index"); this.$router.push("/index");
setTimeout(()=>{
watermark.load({ watermark_txt: res.data.result.userName + res.data.result.userCellFour ,watermark_color:'#aaa',watermark_angle:30,});
},100)
} else { } else {
this.ui.loginLoading = false; this.ui.loginLoading = false;
this.$message({ this.$message({
......
...@@ -7972,10 +7972,10 @@ ...@@ -7972,10 +7972,10 @@
"chokidar" "^3.4.1" "chokidar" "^3.4.1"
"watchpack-chokidar2" "^2.0.1" "watchpack-chokidar2" "^2.0.1"
"watermark-dom@^2.3.0": "watermark-dom@^2.2.1":
"integrity" "sha512-2++fJESs8ULlrOPHEJGi72UxcDmVTsJDZ3kMa5umU6IWc78A4g1kOAqh1k6FEQhrq9QpkV7wzuoUeMhvFlWGWg==" "integrity" "sha512-mHmp+g4sBjvQ6Ew/WCfNfJoxwIAA7FGbUKfd34eJIzOG9Gmlpg+v7A3hykt2JbiU4/ve+K+OCPvQlKiA2wJqew=="
"resolved" "https://registry.npmjs.org/watermark-dom/-/watermark-dom-2.3.0.tgz" "resolved" "https://registry.npmjs.org/watermark-dom/-/watermark-dom-2.2.1.tgz"
"version" "2.3.0" "version" "2.2.1"
"wbuf@^1.1.0", "wbuf@^1.7.3": "wbuf@^1.1.0", "wbuf@^1.7.3":
"integrity" "sha1-wdjRSTFtPqhShIiVy2oL/oh7h98=" "integrity" "sha1-wdjRSTFtPqhShIiVy2oL/oh7h98="
......
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