From 04e21fe58d42c6803459df478076e3321928bb69 Mon Sep 17 00:00:00 2001 From: liudianxin Date: Wed, 24 Jun 2020 15:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu-copy.vue | 478 +++++++++++++++++++++++++++++++++++ src/pages/user/user_info.vue | 75 ++++-- src/request/api/general.js | 3 + 3 files changed, 538 insertions(+), 18 deletions(-) create mode 100644 src/components/menu-copy.vue diff --git a/src/components/menu-copy.vue b/src/components/menu-copy.vue new file mode 100644 index 0000000..e9a2454 --- /dev/null +++ b/src/components/menu-copy.vue @@ -0,0 +1,478 @@ + + + + + + \ No newline at end of file diff --git a/src/pages/user/user_info.vue b/src/pages/user/user_info.vue index 289272c..baa4533 100644 --- a/src/pages/user/user_info.vue +++ b/src/pages/user/user_info.vue @@ -58,12 +58,13 @@ 升级为开发者 升级为开发者 @@ -184,6 +185,7 @@ export default { }, data: () => ({ activeName: "0", + userId: "", is_admin: 0, user_data: { accountNo: "", @@ -227,14 +229,15 @@ export default { this.$api.user.getNowUser().then(response => { if (response.data.success == 1) { this.is_admin = response.data.data.is_admin; - this.getUserInfo(response.data.data.user_id); + this.userId = response.data.data.user_id; + this.getUserInfo(); } else { console.log(response.data.errMsg); } }); }, getUserInfo(id) { - this.$api.user.getUserDetail({ id: id }).then(response => { + this.$api.user.getUserDetail({ id: this.userId }).then(response => { if (response.data.success == 1) { let data = response.data.data; this.user_data.accountNo = data.user_id; @@ -298,6 +301,7 @@ export default { message: "修改个人信息成功", type: "success" }); + this.getUserInfo(); } else { this.$message({ message: "修改个人信息失败", @@ -333,6 +337,7 @@ export default { type: "success" }); this.diaPassWord = false; + this.getUserInfo(); } else { this.$message({ message: "修改密码失败", @@ -342,20 +347,36 @@ export default { }); }, resetKey() { - this.$api.authority - .resetUserKey({ user_id: this.user_data.accountNo }) - .then(response => { - if (response.data.success == 1) { - this.$message({ - message: "重置密钥成功", - type: "success" + this.$confirm("此操作将重置您的密钥, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + cancelButtonClass: "msg_btn_gray", + confirmButtonClass: "msg_btn", + type: "warning" + }) + .then(() => { + this.$api.authority + .resetUserKey({ user_id: this.user_data.accountNo }) + .then(response => { + if (response.data.success == 1) { + this.$message({ + message: "重置密钥成功", + type: "success" + }); + this.getUserInfo(); + } else { + this.$message({ + message: "重置密钥失败", + type: "error" + }); + } }); - } else { - this.$message({ - message: "重置密钥失败", - type: "error" - }); - } + }) + .catch(() => { + this.$message({ + type: "info", + message: "已取消重置" + }); }); }, upLevel() { @@ -366,6 +387,7 @@ export default { type: "success" }); this.couldUp = false; + this.getUserInfo(); } else { this.$message({ message: "申请升级开发者失败", @@ -458,9 +480,7 @@ export default { } .option_btn_gray_dis { width: 124px; - background-color: #e3e5ef; border-radius: 8px; - color: #0f2683; } .info_item { width: 70%; @@ -586,4 +606,23 @@ export default { line-height: 24px; height: 24px; } +.msg_btn { + width: 70px; + background-color: #495feb; + border-radius: 8px; + color: #f8f9fd; +} +.msg_btn:hover { + background-color: #596ffb; +} +.msg_btn_gray { + width: 70px; + background-color: #e3e5ef; + border-radius: 8px; + color: #0f2683; +} +.msg_btn_gray:hover { + background-color: #e8eaf4; + color: #0f2683; +} \ No newline at end of file diff --git a/src/request/api/general.js b/src/request/api/general.js index a9c942e..648e059 100644 --- a/src/request/api/general.js +++ b/src/request/api/general.js @@ -6,6 +6,9 @@ const general = { logout(params) { return axios.get(`/iam/api/logout?ReturnUrl=${encodeURIComponent(params.returnUrl)}`); }, + getNowMenu(params) { + return axios.get(`/apaas/backmgt/menu/user/menu?teamName=${params.teamName}`); + }, } export default general; -- 2.26.0