diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 21f33813..7a353d14 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -510,6 +510,18 @@ export default { this.loginByRole(this.$store.state.user.roles[0].Id) return } + if ( + Array.isArray(this.$store.state.user.roles) && + this.$store.state.user.roles.filter((item) => item.IsUserRoleDisabled) + .length === + this.$store.state.user.roles.length - 1 + ) { + let role = this.$store.state.user.roles.find( + (item) => !item.IsUserRoleDisabled + ) + this.loginByRole(role.Id) + return + } return (this.toggleRoleVisible = true) }, cancel() { diff --git a/src/views/trials/trials-myinfo/account.vue b/src/views/trials/trials-myinfo/account.vue index feb9161b..35244193 100644 --- a/src/views/trials/trials-myinfo/account.vue +++ b/src/views/trials/trials-myinfo/account.vue @@ -119,7 +119,7 @@ v-for="item in roles" :key="item.Id" :label="item.Id" - :disabled="item.isUserRoleDisabled" + :disabled="item.IsUserRoleDisabled" style="margin-bottom: 10px" > {{ item.UserTypeShortName }} @@ -210,6 +210,7 @@ export default { }, computed: { roles() { + console.log(this.$store.state.user.roles, 'this.$store.state.user.roles') return this.$store.state.user.roles }, hasRole() {