htc 21 ore fa
parent
commit
785d1ec4e7
3 ha cambiato i file con 12 aggiunte e 8 eliminazioni
  1. 1 0
      src/views/main-sidebar.vue
  2. 9 7
      src/views/main.vue
  3. 2 1
      src/views/modules/agent/userInfo.vue

+ 1 - 0
src/views/main-sidebar.vue

@@ -31,6 +31,7 @@
         <div class="name">
           <span>{{ $store.state.user.realName }}</span>
           <span class="type" v-if="$store.state.user.superAdmin===1">{{ '管理员' }}</span>
+          <span class="type" v-else-if="$store.state.user.roleCodes==['Coach', 'Admin']">{{ '管理员/教练' }}</span>
           <span class="type" v-else>{{ $store.state.user.qualificationType }}</span>
         </div>
       </div>

+ 9 - 7
src/views/main.vue

@@ -159,13 +159,15 @@ export default {
           if (res.code !== 0) {
             return this.$message.error(res.msg);
           }
-          this.$store.state.user.id = res.data.id;
-          this.$store.state.user.name = res.data.username;
-          this.$store.state.user.realName = res.data.realName;
-          this.$store.state.user.qualificationType = res.data.qualificationType;
-          this.$store.state.user.superAdmin = res.data.superAdmin;
-          this.$store.state.user.roleCodes = res.data.roleCodes;
-          this.$store.state.user.enterpriseId=res.data.enterpriseId;
+          this.$store.state.user.id = res.data?.id;
+          this.$store.state.user.name = res.data?.username;
+          this.$store.state.user.realName = res.data?.realName;
+          this.$store.state.user.qualificationType = res.data?.qualificationType;
+          this.$store.state.user.superAdmin = res.data?.superAdmin;
+          this.$store.state.user.roleCodes = res.data?.roleCodes;
+          this.$store.state.user.enterpriseId=res.data?.enterpriseId;
+          this.$store.state.user.mobile=res.data?.mobile;
+          this.$store.state.user.roleCodes=res.data?.roleCodes;
         })
         .catch(() => {});
     },

+ 2 - 1
src/views/modules/agent/userInfo.vue

@@ -23,8 +23,9 @@
                     <p>密码</p>
                     <p>当前为初始密码,安全性较低,您可以重置密码</p>
                 </div>
-                <div class="p_r">
+                <div class="p_r adfac">
                     <el-button type="primary" @click="resetPwd">重置密码</el-button>
+                    <el-button type="primary" @click="logout" style="margin-left: 10px;">退出登录</el-button>
                 </div>
             </div>
         </div>