Commit 04e21fe5 authored by 刘殿昕's avatar 刘殿昕

个人中心

parent 36e8624f
This diff is collapsed.
...@@ -58,12 +58,13 @@ ...@@ -58,12 +58,13 @@
<el-input v-model="user_data.userTypeName" :disabled="true"></el-input> <el-input v-model="user_data.userTypeName" :disabled="true"></el-input>
<el-button <el-button
v-if="(user_data.userType == 3 || user_data.userType == 4) && couldUp" v-if="(user_data.userType == 3 || user_data.userType == 4) && couldUp"
:class="option_btn" class="option_btn"
@click="upLevel" @click="upLevel"
>升级为开发者</el-button> >升级为开发者</el-button>
<el-button <el-button
v-else-if="(user_data.userType == 3 || user_data.userType == 4) && !couldUp" v-else-if="(user_data.userType == 3 || user_data.userType == 4) && !couldUp"
type="info" type="info"
class="option_btn_gray_dis"
disabled disabled
>升级为开发者</el-button> >升级为开发者</el-button>
</el-form-item> </el-form-item>
...@@ -184,6 +185,7 @@ export default { ...@@ -184,6 +185,7 @@ export default {
}, },
data: () => ({ data: () => ({
activeName: "0", activeName: "0",
userId: "",
is_admin: 0, is_admin: 0,
user_data: { user_data: {
accountNo: "", accountNo: "",
...@@ -227,14 +229,15 @@ export default { ...@@ -227,14 +229,15 @@ export default {
this.$api.user.getNowUser().then(response => { this.$api.user.getNowUser().then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
this.is_admin = response.data.data.is_admin; 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 { } else {
console.log(response.data.errMsg); console.log(response.data.errMsg);
} }
}); });
}, },
getUserInfo(id) { getUserInfo(id) {
this.$api.user.getUserDetail({ id: id }).then(response => { this.$api.user.getUserDetail({ id: this.userId }).then(response => {
if (response.data.success == 1) { if (response.data.success == 1) {
let data = response.data.data; let data = response.data.data;
this.user_data.accountNo = data.user_id; this.user_data.accountNo = data.user_id;
...@@ -298,6 +301,7 @@ export default { ...@@ -298,6 +301,7 @@ export default {
message: "修改个人信息成功", message: "修改个人信息成功",
type: "success" type: "success"
}); });
this.getUserInfo();
} else { } else {
this.$message({ this.$message({
message: "修改个人信息失败", message: "修改个人信息失败",
...@@ -333,6 +337,7 @@ export default { ...@@ -333,6 +337,7 @@ export default {
type: "success" type: "success"
}); });
this.diaPassWord = false; this.diaPassWord = false;
this.getUserInfo();
} else { } else {
this.$message({ this.$message({
message: "修改密码失败", message: "修改密码失败",
...@@ -342,20 +347,36 @@ export default { ...@@ -342,20 +347,36 @@ export default {
}); });
}, },
resetKey() { resetKey() {
this.$api.authority this.$confirm("此操作将重置您的密钥, 是否继续?", "提示", {
.resetUserKey({ user_id: this.user_data.accountNo }) confirmButtonText: "确定",
.then(response => { cancelButtonText: "取消",
if (response.data.success == 1) { cancelButtonClass: "msg_btn_gray",
this.$message({ confirmButtonClass: "msg_btn",
message: "重置密钥成功", type: "warning"
type: "success" })
.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({ .catch(() => {
message: "重置密钥失败", this.$message({
type: "error" type: "info",
}); message: "已取消重置"
} });
}); });
}, },
upLevel() { upLevel() {
...@@ -366,6 +387,7 @@ export default { ...@@ -366,6 +387,7 @@ export default {
type: "success" type: "success"
}); });
this.couldUp = false; this.couldUp = false;
this.getUserInfo();
} else { } else {
this.$message({ this.$message({
message: "申请升级开发者失败", message: "申请升级开发者失败",
...@@ -458,9 +480,7 @@ export default { ...@@ -458,9 +480,7 @@ export default {
} }
.option_btn_gray_dis { .option_btn_gray_dis {
width: 124px; width: 124px;
background-color: #e3e5ef;
border-radius: 8px; border-radius: 8px;
color: #0f2683;
} }
.info_item { .info_item {
width: 70%; width: 70%;
...@@ -586,4 +606,23 @@ export default { ...@@ -586,4 +606,23 @@ export default {
line-height: 24px; line-height: 24px;
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;
}
</style> </style>
\ No newline at end of file
...@@ -6,6 +6,9 @@ const general = { ...@@ -6,6 +6,9 @@ const general = {
logout(params) { logout(params) {
return axios.get(`/iam/api/logout?ReturnUrl=${encodeURIComponent(params.returnUrl)}`); 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; export default general;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment