加密已通
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
"style": {
|
"style": {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
"path": "pages/staff/editStaff/addUser",
|
||||||
|
"style": {}
|
||||||
},{
|
},{
|
||||||
"path": "pages/orderList/OrderDetail/OrderDetail",
|
"path": "pages/orderList/OrderDetail/OrderDetail",
|
||||||
"style": {}
|
"style": {}
|
||||||
@@ -30,10 +33,7 @@
|
|||||||
"path": "pages/staff/editStaff/editStaff",
|
"path": "pages/staff/editStaff/editStaff",
|
||||||
"style": {}
|
"style": {}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/staff/editStaff/addUser",
|
|
||||||
"style": {}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -161,17 +161,23 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
uni.showShareMenu()
|
uni.showShareMenu()
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
this.getSiteInfo()
|
this.getSiteInfo()
|
||||||
|
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
},
|
},
|
||||||
filters: {
|
filters: {
|
||||||
numberFilter(value) {
|
numberFilter(value) {
|
||||||
value = value - 1 + 1
|
if (value) {
|
||||||
return value.toFixed(2)
|
value = value - 1 + 1
|
||||||
|
return value.toFixed(2)
|
||||||
|
} else {
|
||||||
|
return '0.00'
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
loadStatus: 'loading',
|
loadStatus: 'loading',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
onShow() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<form>
|
<form>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">姓名</view>
|
<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>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">手机号</view>
|
<view class="title">手机号</view>
|
||||||
@@ -66,6 +66,32 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
calcMenuList() {
|
||||||
this.checkbox.forEach(item => {
|
this.checkbox.forEach(item => {
|
||||||
console.log(item.checked)
|
console.log(item.checked)
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ export default {
|
|||||||
decrypt(word) { // 解密
|
decrypt(word) { // 解密
|
||||||
var key = CryptoJS.enc.Utf8.parse(keyStr)
|
var key = CryptoJS.enc.Utf8.parse(keyStr)
|
||||||
// var srcs = CryptoJS.enc.Utf8.parse(word)
|
// var srcs = CryptoJS.enc.Utf8.parse(word)
|
||||||
if(word) {
|
if (word) {
|
||||||
word = word.replace(/[\r\n]/g,"")
|
word = word.replace(/[\r\n]/g, "")
|
||||||
}
|
}
|
||||||
var decrypt = CryptoJS.AES.decrypt(word, key, {
|
var decrypt = CryptoJS.AES.decrypt(word, key, {
|
||||||
mode: CryptoJS.mode.ECB,
|
mode: CryptoJS.mode.ECB,
|
||||||
@@ -56,8 +56,13 @@ export default {
|
|||||||
// return decrypt.decrypt(secretWord);
|
// return decrypt.decrypt(secretWord);
|
||||||
// },
|
// },
|
||||||
md5Salt(str) {
|
md5Salt(str) {
|
||||||
console.log('hahahahaha',str, str + "Do&9hY%l8e", md5(str + 'Do&9hY%l8e'))
|
// console.log('hahahahaha',str, str + "Do&9hY%l8e", md5(str + 'Do&9hY%l8e'))
|
||||||
return 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) {
|
md5NoSalt(str) {
|
||||||
return md5(str)
|
return md5(str)
|
||||||
@@ -76,4 +81,4 @@ export default {
|
|||||||
return uuid
|
return uuid
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -62,11 +62,11 @@ service.interceptors.response.use(
|
|||||||
|
|
||||||
// if (env === 'production') {
|
// if (env === 'production') {
|
||||||
// 生产环境,进行加密解密,不输出日志
|
// 生产环境,进行加密解密,不输出日志
|
||||||
// if (res.encrypt === 1) {
|
if (res.encrypt === 1) {
|
||||||
// 加密的数据,需要解密
|
// 加密的数据,需要解密
|
||||||
const dataParam = JSON.parse(utils.decrypt(res.data))
|
const dataParam = JSON.parse(utils.decrypt(res.data))
|
||||||
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
res.data = JSON.stringify(dataParam) === '{}' ? null : dataParam
|
||||||
// }
|
}
|
||||||
// } else {
|
// } else {
|
||||||
console.log('请求路径', response.config.url, '返回结果未加密', res)
|
console.log('请求路径', response.config.url, '返回结果未加密', res)
|
||||||
console.log('-------------------------------------------')
|
console.log('-------------------------------------------')
|
||||||
|
|||||||
Reference in New Issue
Block a user