用户管理加密修改
This commit is contained in:
parent
30c255f407
commit
8834022505
|
|
@ -279,7 +279,9 @@
|
||||||
this.tableListData = response.rows;
|
this.tableListData = response.rows;
|
||||||
this.total = Number(response.total);
|
this.total = Number(response.total);
|
||||||
this.tableListData.forEach(item=>{
|
this.tableListData.forEach(item=>{
|
||||||
|
if(item.contactTel){
|
||||||
this.$set(item,"contactTel",decryptWithSM4(item.contactTel))
|
this.$set(item,"contactTel",decryptWithSM4(item.contactTel))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -758,7 +758,7 @@ import { validateNewPassword } from '@/utils/validate'
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import { imgUpLoadTwo } from '@/api/system/upload'
|
import { imgUpLoadTwo } from '@/api/system/upload'
|
||||||
|
import { decryptWithSM4,encryptWithSM4 } from '@/utils/sm';
|
||||||
export default {
|
export default {
|
||||||
name: 'User',
|
name: 'User',
|
||||||
dicts: [
|
dicts: [
|
||||||
|
|
@ -1000,6 +1000,11 @@ export default {
|
||||||
(response) => {
|
(response) => {
|
||||||
this.userList = response.rows
|
this.userList = response.rows
|
||||||
this.total = response.total
|
this.total = response.total
|
||||||
|
this.userList.forEach(item=>{
|
||||||
|
if(item.phonenumber){
|
||||||
|
this.$set(item,"phonenumber",decryptWithSM4(item.phonenumber))
|
||||||
|
}
|
||||||
|
})
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
@ -1153,6 +1158,12 @@ export default {
|
||||||
const userId = row.userId || this.ids
|
const userId = row.userId || this.ids
|
||||||
getUser(userId).then((response) => {
|
getUser(userId).then((response) => {
|
||||||
this.form = response.data
|
this.form = response.data
|
||||||
|
if(this.form.phonenumber){
|
||||||
|
this.$set(this.form,"phonenumber",decryptWithSM4(response.data.phonenumber))
|
||||||
|
}
|
||||||
|
if(this.form.email){
|
||||||
|
this.$set(this.form,"email",decryptWithSM4(response.data.email))
|
||||||
|
}
|
||||||
const loginType = response.data.loginType
|
const loginType = response.data.loginType
|
||||||
if (loginType) {
|
if (loginType) {
|
||||||
this.loginTypeArr = loginType.split(',')
|
this.loginTypeArr = loginType.split(',')
|
||||||
|
|
@ -1252,13 +1263,12 @@ export default {
|
||||||
}
|
}
|
||||||
validateNewPassword(null, value, errorMessage)
|
validateNewPassword(null, value, errorMessage)
|
||||||
},
|
},
|
||||||
})
|
}).then(({ value }) => {
|
||||||
.then(({ value }) => {
|
let password = encryptWithSM4(value)
|
||||||
resetUserPwd(row.userId, value).then((response) => {
|
resetUserPwd(row.userId, password).then((response) => {
|
||||||
this.$modal.msgSuccess('修改成功,新密码是:' + value)
|
this.$modal.msgSuccess('修改成功,新密码是:' + value)
|
||||||
})
|
})
|
||||||
})
|
}).catch(() => {})
|
||||||
.catch(() => {})
|
|
||||||
},
|
},
|
||||||
/** 分配角色操作 */
|
/** 分配角色操作 */
|
||||||
handleAuthRole: function (row) {
|
handleAuthRole: function (row) {
|
||||||
|
|
@ -1282,15 +1292,22 @@ export default {
|
||||||
this.form.effectiveStartDay = null
|
this.form.effectiveStartDay = null
|
||||||
this.form.effectiveEndDay = null
|
this.form.effectiveEndDay = null
|
||||||
}
|
}
|
||||||
|
let param = Object.assign({},this.form)
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.userId != undefined) {
|
if(param.phonenumber&¶m.phonenumber!=""){
|
||||||
updateUser(this.form).then((response) => {
|
this.$set(param,"phonenumber",encryptWithSM4(param.phonenumber))
|
||||||
|
}
|
||||||
|
if(param.email&¶m.email!=""){
|
||||||
|
this.$set(param,"email",encryptWithSM4(param.email))
|
||||||
|
}
|
||||||
|
if (param.userId != undefined) {
|
||||||
|
updateUser(param).then((response) => {
|
||||||
this.$modal.msgSuccess('修改成功')
|
this.$modal.msgSuccess('修改成功')
|
||||||
this.open = false
|
this.open = false
|
||||||
this.getList()
|
this.getList()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
addUser(this.form).then((response) => {
|
addUser(param).then((response) => {
|
||||||
this.$modal.msgSuccess('新增成功')
|
this.$modal.msgSuccess('新增成功')
|
||||||
this.open = false
|
this.open = false
|
||||||
this.getList()
|
this.getList()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue