加密已通
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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('-------------------------------------------')
|
||||
|
||||
Reference in New Issue
Block a user