Q-ABAB 2 سال پیش
والد
کامیت
b4b141716e
3فایلهای تغییر یافته به همراه22 افزوده شده و 11 حذف شده
  1. 16 4
      src/App.vue
  2. 5 6
      src/config/config.js
  3. 1 1
      src/views/projectManage/ProjectManagementMain.vue

+ 16 - 4
src/App.vue

@@ -4,7 +4,7 @@
       <img src="./assets/img/sclogo4.png" alt="" />
       <!-- <img src="@/assets/img/szjsxy.png" alt=""> -->
       <div class="homeExitContent">
-        <div>你好,{{ $store.state.userInfo.tname }}</div>
+        <div>你好,{{ $store.state.userInfo.username }}</div>
         <div class="homeExit" @click="homeExit">退出</div>
       </div>
     </el-header>
@@ -21,12 +21,24 @@ export default {
   methods: {
     homeExit() {
       window.location.href = "http://10.16.30.130/sso/caslogout.jsp";
-      // this.$router.push("/login");
+
     },
+    userLogin(){
+      this.ajax.post(this.$store.state.api+'/userLogin',{
+        id:getToken(),
+      }).then(res=>{
+        if(res['data']!="ERROR"){
+          this.$store.commit('update',['userInfo',res['data']])
+        }else{
+          console.error("错误")
+        }
+      }).catch(err=>{
+        console.log(err)
+      })
+    }
   },
   mounted(){
-    // console.log(getToken())
-    // getToken()
+    this.userLogin();
   }
 };
 </script>

+ 5 - 6
src/config/config.js

@@ -10,14 +10,13 @@ const store = new Vuex.Store({
         isLogin: false,
         luyou: 1,
         userInfo: {
-            userid: "55f791b7-be42-11ed-b8f7-509a4c5b67cf",
-            username: "test@qq.com",
-            sessionid: null,
+            // userid: "55f791b7-be42-11ed-b8f7-509a4c5b67cf",
+            // userid:"6cd6348e-be42-11ed-b8f7-509a4c5b67cf",
+            userid:"1270",    //管理员账号
+            username: "测试账号",
             type: 1,
-            tname: "测试账号",
-            classid: "",
-            state: 0,
         },
+        AdminAcc:['1270'],
         nCount: 0,
         report: "",
         // api: 'https://pbl.cocorobo.cn/api/pbl/',

+ 1 - 1
src/views/projectManage/ProjectManagementMain.vue

@@ -58,7 +58,7 @@
         },
         methods:{
             goto(val,aid=''){
-                this.show=val
+                this.show = val
                 this.AidShow = aid;
             },
         },