zzy 2 vuotta sitten
vanhempi
commit
93e027794a
1 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 12 1
      src/components/header/Header.vue

+ 12 - 1
src/components/header/Header.vue

@@ -14,6 +14,7 @@
  <span v-for="item in headerArr.slice(3)" :key="item.id" class="title">
           <span class="role_button" :class="[item.chosen?'title_min_chosen':'title_min']" :role_button_code="item.role_button_code"   @click="clickFn(item.component)">{{item.name}}</span>
         </span>
+    <span class="title role_title" @click="loginOut">{{userName}} ,退出</span>
   </div>
 </div>
 </template>
@@ -22,11 +23,12 @@
 import {mapMutations, mapState} from "vuex";
 import {mapEletricCardMutations, mapEvaluateMutations} from "@/units/map-units";
 import selectConfigModuleByRole from "@/role_button";
-
+import {userExit} from "@/commomUse";
 export default {
   name: "Header",
   data(){
     return{
+      userName:'',
       headerArr:[
         {
           id:'1',
@@ -84,6 +86,7 @@ export default {
     })
   },
   mounted(){
+    this.userName =localStorage.getItem("ywtb_username")
     selectConfigModuleByRole(this);
     console.log(this.$route.path);
     for(let i=0;i<this.headerArr.length;i++){
@@ -96,6 +99,9 @@ export default {
     }
   },
   methods:{
+    loginOut:function (){
+      userExit(this);
+    },
     clickFn:function(component){
       this.$router.push(''+ component +'');
       this.matterGuidanceRefresh(true);
@@ -262,6 +268,11 @@ export default {
       width: 50%;
       text-align: center;
     }
+    .role_title{
+      font-size: 16px;
+      cursor: pointer;
+      color:#2aaef2;
+    }
   }
 }
 </style>