From 88340225054bdc0b90a993ef13962b995e72ce1e Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Fri, 4 Jul 2025 13:17:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canteen/base/mobile/complaint/index.vue | 2 ++ src/views/system/user/index.vue | 35 ++++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/views/canteen/base/mobile/complaint/index.vue b/src/views/canteen/base/mobile/complaint/index.vue index 0d2687a0..78297981 100644 --- a/src/views/canteen/base/mobile/complaint/index.vue +++ b/src/views/canteen/base/mobile/complaint/index.vue @@ -279,7 +279,9 @@ this.tableListData = response.rows; this.total = Number(response.total); this.tableListData.forEach(item=>{ + if(item.contactTel){ this.$set(item,"contactTel",decryptWithSM4(item.contactTel)) + } }) this.loading = false; }); diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c73f396c..905ed8dc 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -758,7 +758,7 @@ import { validateNewPassword } from '@/utils/validate' import store from "@/store"; import { imgUpLoadTwo } from '@/api/system/upload' - +import { decryptWithSM4,encryptWithSM4 } from '@/utils/sm'; export default { name: 'User', dicts: [ @@ -1000,6 +1000,11 @@ export default { (response) => { this.userList = response.rows this.total = response.total + this.userList.forEach(item=>{ + if(item.phonenumber){ + this.$set(item,"phonenumber",decryptWithSM4(item.phonenumber)) + } + }) this.loading = false }, ) @@ -1153,6 +1158,12 @@ export default { const userId = row.userId || this.ids getUser(userId).then((response) => { 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 if (loginType) { this.loginTypeArr = loginType.split(',') @@ -1252,13 +1263,12 @@ export default { } validateNewPassword(null, value, errorMessage) }, - }) - .then(({ value }) => { - resetUserPwd(row.userId, value).then((response) => { + }).then(({ value }) => { + let password = encryptWithSM4(value) + resetUserPwd(row.userId, password).then((response) => { this.$modal.msgSuccess('修改成功,新密码是:' + value) }) - }) - .catch(() => {}) + }).catch(() => {}) }, /** 分配角色操作 */ handleAuthRole: function (row) { @@ -1282,15 +1292,22 @@ export default { this.form.effectiveStartDay = null this.form.effectiveEndDay = null } + let param = Object.assign({},this.form) if (valid) { - if (this.form.userId != undefined) { - updateUser(this.form).then((response) => { + if(param.phonenumber&¶m.phonenumber!=""){ + 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.open = false this.getList() }) } else { - addUser(this.form).then((response) => { + addUser(param).then((response) => { this.$modal.msgSuccess('新增成功') this.open = false this.getList()