yuwandanmian 1 жил өмнө
parent
commit
b34a39abc2

+ 5 - 1
src/layout/components/Navbar.vue

@@ -46,7 +46,11 @@ export default {
     async logout() {
       await this.$store.dispatch('user/logout')
       const preUrl = sessionStorage.getItem("preUrl")
-      this.$router.push({ path: '/login', query: { preUrl }})
+      if (preUrl) {
+        this.$router.push({ path: '/login', query: { preUrl }})
+      } else {
+        this.$router.push({ path: '/login' })
+      }
     },
   },
 };

+ 13 - 2
src/views/404.vue

@@ -11,11 +11,11 @@
         <div class="bullshit__oops">OOPS!</div>
         <div class="bullshit__info">
           All rights reserved
-          <a style="color: #20a0ff" href="https://wallstreetcn.com" target="_blank">wallstreetcn</a>
+          <a style="color: #20a0ff" href="javascript:;">wallstreetcn</a>
         </div>
         <div class="bullshit__headline">{{ message }}</div>
         <div class="bullshit__info">Please check that the URL you entered is correct, or click the button below to return to the homepage.</div>
-        <a href="" class="bullshit__return-home">Back to home</a>
+        <a href="javascript:;" class="bullshit__return-home" @click="logout">Back to home</a>
       </div>
     </div>
   </div>
@@ -29,6 +29,17 @@ export default {
       return 'The webmaster said that you can not enter this page...';
     },
   },
+  methods: {
+    async logout() {
+      await this.$store.dispatch('user/logout')
+      const preUrl = sessionStorage.getItem("preUrl")
+      if (preUrl) {
+        this.$router.push({ path: '/login', query: { preUrl }})
+      } else {
+        this.$router.push({ path: '/login' })
+      }
+    },
+  }
 };
 </script>