diff --git a/src/assets/imgs/login_eye.png b/src/assets/imgs/login_eye.png new file mode 100644 index 0000000000000000000000000000000000000000..9e65d6bacfc0dacb4def35316e5e50c3a64885eb Binary files /dev/null and b/src/assets/imgs/login_eye.png differ diff --git a/src/assets/imgs/login_eye_dis.png b/src/assets/imgs/login_eye_dis.png new file mode 100644 index 0000000000000000000000000000000000000000..015a03460e2d5b4972d9ff89f808fae91d430224 Binary files /dev/null and b/src/assets/imgs/login_eye_dis.png differ diff --git a/src/pages/user/user_info.vue b/src/pages/user/user_info.vue index ece726904359d7d9342bc1c788c6304b409c26b8..395db051c8d044349a9222df730f5148a3ea6ce1 100644 --- a/src/pages/user/user_info.vue +++ b/src/pages/user/user_info.vue @@ -51,17 +51,12 @@

组织机构:

- +

当前用户类型:

- - - - 升级为开发者 + + 升级为开发者
@@ -111,7 +106,7 @@

密钥:

复制 - 重置 + 重置

描述:

@@ -137,11 +132,27 @@

新密码:

- + + +

请再次输入密码:

- + + +
@@ -173,8 +184,11 @@ export default { phone: "", email: "", organization: "", - userType: "" + userType: "", + userTypeName: "" }, + visible1: true, + visible2: true, form: { passwordOld: "", passwordNew: "", @@ -207,13 +221,7 @@ export default { blackAddShow: false, newIpWhite: "", newIpBlack: "", - diaPassWord: false, - userTypeOptions: [ - { value: 1, label: "超级管理员" }, - { value: 2, label: "组织管理员" }, - { value: 3, label: "普通用户" }, - { value: 4, label: "普通用户开发者" } - ] + diaPassWord: false }), mounted() { this.getCurrentUser(); @@ -240,6 +248,14 @@ export default { this.user_data.email = data.email; this.user_data.organization = data.department; this.user_data.userType = data.is_admin; + this.user_data.userTypeName = + this.user_data.userType == 1 + ? "超级管理员" + : this.user_data.userType == 2 + ? "组织管理员" + : this.user_data.userType == 3 + ? "普通用户" + : "普通用户开发者"; this.imgList.push(data.picture_path); this.formBusiness.businessSystemName = data.system_name; this.formBusiness.domainName = data.domain_name; @@ -296,10 +312,23 @@ export default { changePassword() { this.diaPassWord = true; }, + changePass1() { + this.visible1 = !this.visible1; + }, + changePass2() { + this.visible2 = !this.visible2; + }, cancelChangePwd() { this.diaPassWord = false; }, submitChangePwd() { + let query = { + id: this.user_data.accountNo, + form: { + origin_password: this.form.passwordOld, + new_password: this.form.passwordNew + } + } this.$api.user.editUserPassword(query).then(response => { if (response.data.success == 1) { this.$message({ @@ -315,7 +344,38 @@ export default { } }); }, - upLevel() {}, + resetKey() { + this.$api.authority + .resetUserKey({ user_id: this.user_data.accountNo }) + .then(response => { + if (response.data.success == 1) { + this.$message({ + message: "重置密钥成功", + type: "success" + }); + } else { + this.$message({ + message: "重置密钥失败", + type: "error" + }); + } + }); + }, + upLevel() { + this.$api.authority.updateLevel().then(response => { + if (response.data.success == 1) { + this.$message({ + message: "重置密钥成功", + type: "success" + }); + } else { + this.$message({ + message: "重置密钥失败", + type: "error" + }); + } + }); + }, copyKey() { this.$refs.keys.select(); document.execCommand("Copy"); @@ -465,6 +525,24 @@ export default { margin-right: 10px; margin-bottom: 10px; } +.eye { + display: inline-block; + width: 20px; + height: 20px; + position: relative; + top: 4px; + cursor: pointer; + background: url("~@/assets/imgs/login_eye.png") no-repeat center center; +} +.eye_dis { + display: inline-block; + width: 20px; + height: 20px; + position: relative; + top: 6px; + cursor: pointer; + background: url("~@/assets/imgs/login_eye_dis.png") no-repeat center center; +}