diff --git a/src/views/trials/trials-myinfo/account.vue b/src/views/trials/trials-myinfo/account.vue
index d927ffc..5f6b571 100644
--- a/src/views/trials/trials-myinfo/account.vue
+++ b/src/views/trials/trials-myinfo/account.vue
@@ -7,130 +7,72 @@
-
+
{{ user.UserName }}
-
+
-
+
{{ $t("trials:trials-myinfo:button:update") }}
-
+
{{ user.CheckCode }}
-
+
-
+
{{ $t("trials:trials-myinfo:button:update") }}
-
+
{{ user.Phone }}
-
+
-
+
{{ $t("trials:trials-myinfo:button:update") }}
-
+
{{ user.EMail }}
-
-
- {{ sendTitle }}
+
+
+ {{ sendTitle }}
-
-
+
+
-
+
{{ $t("trials:trials-myinfo:button:update") }}
+
+
+
+ {{ item.UserTypeShortName }}
+
+
+
+
+ {{ $t('trials:trials-myinfo:button:toggleRole') }}
+
+
@@ -168,9 +110,43 @@ export default {
userForm: {},
sendDisabled: true,
sendTitle: this.$t("trials:trials-myinfo:button:getVCode"),
+ userRoleId: null,
+ toggleRoleLoading: false,
};
},
+ created() {
+ this.userRoleId = zzSessionStorage.getItem('userId')
+ },
+ computed: {
+ roles() {
+ return this.$store.state.user.roles
+ },
+ hasRole() {
+ return this.roles && this.roles.length > 1
+ },
+ saveDisabled() {
+ return this.userRoleId === zzSessionStorage.getItem('userId')
+ },
+ },
methods: {
+ // 切换角色
+ toggleRole() {
+ if (
+ this.userRoleId === zzSessionStorage.getItem('userId') ||
+ this.toggleRoleLoading
+ )
+ return false
+ this.toggleRoleLoading = true
+ this.$store
+ .dispatch('user/loginByRole', { userRoleId: this.userRoleId })
+ .then((res) => {
+ zzSessionStorage.removeItem('lastWorkbench')
+ window.location.reload()
+ })
+ .catch(() => {
+ this.toggleRoleLoading = false
+ })
+ },
// 修改校验码
async setNewUserCheckCode() {
try {