加密已通

lixuan
xk_guohonglei 4 years ago
parent fc6ae600a4
commit 39d433998a
  1. 8
      pages.json
  2. 12
      pages/index/index.vue
  3. 2
      pages/staff/List/List.vue
  4. 28
      pages/staff/editStaff/addUser.vue
  5. 15
      utils/encode.js
  6. 4
      utils/request.js

@ -5,6 +5,9 @@
"style": {
}
},{
"path": "pages/staff/editStaff/addUser",
"style": {}
},{
"path": "pages/orderList/OrderDetail/OrderDetail",
"style": {}
@ -30,10 +33,7 @@
"path": "pages/staff/editStaff/editStaff",
"style": {}
},
{
"path": "pages/staff/editStaff/addUser",
"style": {}
},

@ -161,17 +161,23 @@
},
onLoad() {
uni.showShareMenu()
},
onShow() {
this.getUserInfo()
this.getSiteInfo()
},
onPullDownRefresh() {
this.getUserInfo()
},
filters: {
numberFilter(value) {
value = value - 1 + 1
return value.toFixed(2)
if (value) {
value = value - 1 + 1
return value.toFixed(2)
} else {
return '0.00'
}
}
},
methods: {

@ -52,7 +52,7 @@
loadStatus: 'loading',
};
},
created() {
onShow() {
this.getList()
},
onPullDownRefresh() {

@ -8,7 +8,7 @@
<form>
<view class="cu-form-group">
<view class="title">姓名</view>
<input v-model="userInfo.cUserName" placeholder="请输入姓名" name="input" />
<input :maxlength="8" @input="getChinese" :value="userInfo.cUserName" @blur="showChinese" placeholder="请输入姓名" name="input" />
</view>
<view class="cu-form-group">
<view class="title">手机号</view>
@ -66,6 +66,32 @@
}
},
methods: {
showChinese() {
const reg = /[\u4e00-\u9fa5]/g
var names = this.userInfo.cUserName.match(reg);
this.userInfo.cUserName = names.join("")
if (names) {
this.$set(this.userInfo, 'cUserName', names.join(""))
}
},
//
getChinese(e) {
var value = e.target.value
console.log('e-target-value', value)
if (value !== null && value !== '') {
const reg = /[\u4e00-\u9fa5]/g
var names = value.match(reg);
// console.log(names)
// this.$set(this.userInfo, 'cUserName', names.join(""))
if (names) {
this.$set(this.userInfo, 'cUserName', names.join(""))
}
console.log('v-model-name', this.userInfo.cUserName)
}
},
calcMenuList() {
this.checkbox.forEach(item => {
console.log(item.checked)

@ -22,8 +22,8 @@ export default {
decrypt(word) { // 解密
var key = CryptoJS.enc.Utf8.parse(keyStr)
// var srcs = CryptoJS.enc.Utf8.parse(word)
if(word) {
word = word.replace(/[\r\n]/g,"")
if (word) {
word = word.replace(/[\r\n]/g, "")
}
var decrypt = CryptoJS.AES.decrypt(word, key, {
mode: CryptoJS.mode.ECB,
@ -56,8 +56,13 @@ export default {
// return decrypt.decrypt(secretWord);
// },
md5Salt(str) {
console.log('hahahahaha',str, str + "Do&9hY%l8e", md5(str + 'Do&9hY%l8e'))
return md5(str + 'Do&9hY%l8e')
// console.log('hahahahaha',str, str + "Do&9hY%l8e", md5(str + 'Do&9hY%l8e'))
// str ='fd3fc615-3554-4ff5-8848-364577e8687d'
console.log('hahahahaha', str, str + "kdq*&qflbn1gga?aDq", md5(str + 'kdq*&qflbn1gga?aDq'))
console.log('\n\n------ begin: ------')
console.log("md5(str + 'kdq*&qflbn1gga?aDq')", md5(str + 'kdq*&qflbn1gga?aDq'))
console.log('------ end: ------\n\n')
return md5(str + 'kdq*&qflbn1gga?aDq')
},
md5NoSalt(str) {
return md5(str)
@ -76,4 +81,4 @@ export default {
return uuid
}
}
}

@ -62,11 +62,11 @@ service.interceptors.response.use(
// if (env === 'production') {
// 生产环境,进行加密解密,不输出日志
// if (res.encrypt === 1) {
if (res.encrypt === 1) {
// 加密的数据,需要解密
const dataParam = JSON.parse(utils.decrypt(res.data))
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
// }
}
// } else {
console.log('请求路径', response.config.url, '返回结果未加密', res)
console.log('-------------------------------------------')

Loading…
Cancel
Save