Commit 51cf26f6efc47aa9553c53ffe6787e921d8cf101

Authored by 李宇
1 parent fb82c607

1

yanshouban/src/main.js
... ... @@ -12,7 +12,7 @@ import '@/assets/font.css'
12 12 import App from './App.vue'
13 13 import store from './store'
14 14 import router from './router'
15   -import {encrypt,decrypt,decryptall} from './utils/jiami.js'
  15 +import {encrypt,decrypt,decryptall,encryptall} from './utils/jiami.js'
16 16 import '@/icons' // icon
17 17 import '@/permission' // permission control
18 18  
... ... @@ -31,6 +31,7 @@ Vue.prototype.$API = 'https://jy.scjysm.asia:18086/meserver/api'
31 31 Vue.prototype.$encrypt = encrypt;
32 32 Vue.prototype.$decrypt = decrypt;
33 33 Vue.prototype.$decryptall = decryptall;
  34 +Vue.prototype.$encryptall = encryptall;
34 35 // Vue.prototype.$API = 'https://wjdc.scjysm.asia:1443/meserver/api'
35 36 // Vue.prototype.$API = 'http://8.130.38.56:8019/api'
36 37 // https://jy.scjysm.asia:18086 http://172.16.61.126:8080 http://8.130.38.56:8027
... ...
yanshouban/src/utils/jiami.js
... ... @@ -34,7 +34,7 @@ export const decrypt = (str) => {
34 34         return '解密失败!'
35 35     }
36 36 }
37   -
  37 +// 批量加密
38 38 export const decryptall = (obj,isjmlist) => {
39 39 console.error(isjmlist)
40 40 console.error(obj)
... ... @@ -72,4 +72,25 @@ export const decryptall = (obj,isjmlist) => {
72 72 });
73 73 console.log(objnew);
74 74 return objnew
  75 +}
  76 +// 批量解密
  77 +export const encryptall = (list,isjmlist) => {
  78 + console.error(isjmlist)
  79 + console.error(list)
  80 + let newlist = list.map(element => {
  81 + let c1 = Object.keys(element)
  82 + c1.forEach(key => {
  83 + if(isjmlist.length> 0) {
  84 + console.log(isjmlist.indexOf(key) != -1)
  85 + if(isjmlist.indexOf(key) != -1) {
  86 + element[key] = decrypt(element[key])
  87 + }
  88 + } else {
  89 + element[key] = decrypt(element[key])
  90 + }
  91 + });
  92 + return element
  93 + });
  94 + console.error(newlist)
  95 + return newlist
75 96 }
76 97 \ No newline at end of file
... ...
yanshouban/src/views/business/businessList/index.vue
... ... @@ -948,7 +948,7 @@ export default {
948 948 }
949 949  
950 950 if (!this.userState) {
951   -
  951 +
952 952 // this.ruleForm.shopPhone = this.$encrypt(this.ruleForm.shopPhone)
953 953 // this.ruleForm.shopPassword = this.$encrypt(this.ruleForm.shopPassword)
954 954 // this.ruleForm.idCardNum = this.$encrypt(this.ruleForm.idCardNum)
... ...