Browse Source

新增退出

MSI\liwei 2 years ago
parent
commit
79d1f2f9d0
2 changed files with 24 additions and 3 deletions
  1. 2 1
      public/index.html
  2. 22 2
      src/components/HeaderDiv/index.vue

+ 2 - 1
public/index.html

@@ -13,7 +13,7 @@
     <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
     <style>
         html,
-        body,
+        body, 
         #app {
             height: 100%;
             margin: 0px;
@@ -32,6 +32,7 @@
             position: fixed;
             top: 0;
             left: 0;
+            
             width: 100%;
             height: 100%;
             z-index: 999999;

+ 22 - 2
src/components/HeaderDiv/index.vue

@@ -54,6 +54,9 @@
         <div class="time">
             <img src="../../assets/images/图层 9@2x.png" /><span>{{ currenttime }}</span>
         </div>
+        <div class="logoutIcon">
+              <i class="el-icon-switch-button" style="width:6rem;color:white"  @click.native="logout"></i>
+        </div>
     </div>
 </template>
 
@@ -96,6 +99,17 @@ export default {
         }, 1000);
     },
   methods: {
+     async logout() {
+      this.$confirm('确定注销并退出系统吗?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.$store.dispatch('LogOut').then(() => {
+          location.href = '/index';
+        })
+      }).catch(() => {});
+    },
     goTarget(index) {
       if(index == 1){
             this.$router.push('/big');
@@ -113,7 +127,7 @@ export default {
       }else if(index == 5){
            this.$router.push('/public')
       }else if(index == 6){
-           this.$router.push('/qdlt/area')
+           this.$router.push('/plan/statics')
       }else if(index == 7){
            this.$router.push('/introduction')
       }else if(index == 12){
@@ -182,7 +196,7 @@ export default {
     .time {
         position: absolute;
         top: 1.2rem;
-        right: 4.7rem;
+        right: 6.7rem;
         font-size: 1.6rem;
         color: #fff;
         img {
@@ -193,6 +207,12 @@ export default {
             margin-right: 1.6rem;
         }
     }
+    .logoutIcon {
+        position: absolute;
+        top: 0.8rem;
+        right: 0.1rem;
+         font-size: 2rem;
+    }
 }
 .bottombg{
   background: url("../../assets/images/底部菜单bg@2x.png");