From 51cf26f6efc47aa9553c53ffe6787e921d8cf101 Mon Sep 17 00:00:00 2001 From: liy <1492230202@qq.com> Date: Wed, 18 Dec 2024 22:37:51 +0800 Subject: [PATCH] 1 --- yanshouban/src/main.js | 3 ++- yanshouban/src/utils/jiami.js | 23 ++++++++++++++++++++++- yanshouban/src/views/business/businessList/index.vue | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/yanshouban/src/main.js b/yanshouban/src/main.js index a63e656..c82e1f7 100644 --- a/yanshouban/src/main.js +++ b/yanshouban/src/main.js @@ -12,7 +12,7 @@ import '@/assets/font.css' import App from './App.vue' import store from './store' import router from './router' -import {encrypt,decrypt,decryptall} from './utils/jiami.js' +import {encrypt,decrypt,decryptall,encryptall} from './utils/jiami.js' import '@/icons' // icon import '@/permission' // permission control @@ -31,6 +31,7 @@ Vue.prototype.$API = 'https://jy.scjysm.asia:18086/meserver/api' Vue.prototype.$encrypt = encrypt; Vue.prototype.$decrypt = decrypt; Vue.prototype.$decryptall = decryptall; +Vue.prototype.$encryptall = encryptall; // Vue.prototype.$API = 'https://wjdc.scjysm.asia:1443/meserver/api' // Vue.prototype.$API = 'http://8.130.38.56:8019/api' // https://jy.scjysm.asia:18086 http://172.16.61.126:8080 http://8.130.38.56:8027 diff --git a/yanshouban/src/utils/jiami.js b/yanshouban/src/utils/jiami.js index 659fff3..79ed232 100644 --- a/yanshouban/src/utils/jiami.js +++ b/yanshouban/src/utils/jiami.js @@ -34,7 +34,7 @@ export const decrypt = (str) => {         return '解密失败!'     } } - +// 批量加密 export const decryptall = (obj,isjmlist) => { console.error(isjmlist) console.error(obj) @@ -72,4 +72,25 @@ export const decryptall = (obj,isjmlist) => { }); console.log(objnew); return objnew +} +// 批量解密 +export const encryptall = (list,isjmlist) => { + console.error(isjmlist) + console.error(list) + let newlist = list.map(element => { + let c1 = Object.keys(element) + c1.forEach(key => { + if(isjmlist.length> 0) { + console.log(isjmlist.indexOf(key) != -1) + if(isjmlist.indexOf(key) != -1) { + element[key] = decrypt(element[key]) + } + } else { + element[key] = decrypt(element[key]) + } + }); + return element + }); + console.error(newlist) + return newlist } \ No newline at end of file diff --git a/yanshouban/src/views/business/businessList/index.vue b/yanshouban/src/views/business/businessList/index.vue index cb548be..700f4d1 100644 --- a/yanshouban/src/views/business/businessList/index.vue +++ b/yanshouban/src/views/business/businessList/index.vue @@ -948,7 +948,7 @@ export default { } if (!this.userState) { - + // this.ruleForm.shopPhone = this.$encrypt(this.ruleForm.shopPhone) // this.ruleForm.shopPassword = this.$encrypt(this.ruleForm.shopPassword) // this.ruleForm.idCardNum = this.$encrypt(this.ruleForm.idCardNum) -- libgit2 0.21.4