lsc 7 months ago
parent
commit
cb009ddd91

File diff suppressed because it is too large
+ 0 - 0
dist/css/app.5684ae86.css


File diff suppressed because it is too large
+ 0 - 0
dist/css/app.b5b59d6e.css


+ 1 - 1
dist/index.html

@@ -36,4 +36,4 @@
         width: 100%;
         background: #e6eaf0;
         font-family: '黑体';
-      }</style><script defer="defer" src="/js/chunk-vendors.54a29291.js"></script><script defer="defer" src="/js/app.9cd4eae9.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.b5b59d6e.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
+      }</style><script defer="defer" src="/js/chunk-vendors.54a29291.js"></script><script defer="defer" src="/js/app.ff2c17d4.js"></script><link href="/css/chunk-vendors.7cfe4581.css" rel="stylesheet"><link href="/css/app.5684ae86.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but userManage doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>

File diff suppressed because it is too large
+ 0 - 0
dist/js/app.9cd4eae9.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.9cd4eae9.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.ff2c17d4.js


File diff suppressed because it is too large
+ 0 - 0
dist/js/app.ff2c17d4.js.map


+ 1 - 1
src/permission.js

@@ -5,7 +5,7 @@ import 'nprogress/nprogress.css' // progress bar style
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['/login'] // no redirect whitelist
+const whiteList = ['/login', 'examineDialog'] // no redirect whitelist
 
 router.beforeEach(async (to, from, next) => {
   // start progress bar

+ 24 - 10
src/views/HomeView.vue

@@ -4,6 +4,7 @@
       <div class="title">CocoClass后台管理</div>
       <div class="person">
         <div class="person_name">{{ userinfo ? userinfo.username : '' }}</div>
+        <el-button type="text" @click="handleLogout" style="margin-left: 20px">退出</el-button>
       </div>
     </div>
     <div class="container">
@@ -25,22 +26,35 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters, mapActions } from 'vuex';
 
 export default {
   name: "HomeView",
   computed: {
     ...mapGetters(['userinfo']),
   },
-  data() {
-    return {};
+  methods: {
+    ...mapActions({
+      logout: 'user/logout'
+    }),
+    async handleLogout() {
+      this.$confirm('确定退出吗', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        await this.logout();
+        this.$router.push('/login');
+      }).catch(() => {
+        // 取消操作
+      });
+    }
   },
   mounted() {},
 };
 </script>
 
 <style scoped>
-
 .body {
   width: 100%;
   height: 100%;
@@ -62,22 +76,24 @@ export default {
 }
 .person {
   margin-left: auto;
+  display: flex;
+  align-items: center;
 }
 .person > .person_name {
   font-size: 15px;
   color: black;
   font-weight: 400;
 }
-.container{
+.container {
   display: flex;
   width: 100%;
   height: calc(100% - 50px);
   overflow: hidden;
 }
 .table-container {
-    width: calc(100% - 180px);
-    overflow: hidden;
-    height: 100%;
+  width: calc(100% - 180px);
+  overflow: hidden;
+  height: 100%;
 }
 .left {
   width: 180px;
@@ -92,7 +108,6 @@ export default {
   width: 100%;
   background-color: #ffffff;
 }
-
 .menu_left {
   width: 100%;
   height: 50px;
@@ -104,7 +119,6 @@ export default {
   align-items: center;
   justify-content: center;
 }
-
 .router-link-active {
   background-color: #3d67bc;
   color: rgb(255, 255, 255);

Some files were not shown because too many files changed in this diff