Pārlūkot izejas kodu

更改跳转逻辑和token获取逻辑

ming 3 gadi atpakaļ
vecāks
revīzija
1f7f3b29c4
9 mainītis faili ar 18 papildinājumiem un 20 dzēšanām
  1. BIN
      dist.zip
  2. BIN
      dist1.zip
  3. BIN
      dist2.zip
  4. BIN
      dist3.zip
  5. BIN
      dist4.zip
  6. BIN
      dist5.zip
  7. 7 8
      src/main.js
  8. 5 6
      src/utils/request.js
  9. 6 6
      src/views/login.vue

BIN
dist.zip


BIN
dist1.zip


BIN
dist2.zip


BIN
dist3.zip


BIN
dist4.zip


BIN
dist5.zip


+ 7 - 8
src/main.js

@@ -47,14 +47,13 @@ router.beforeEach((to, from, next) => {
         if (localStorage.getItem('accessToken') === null) {
             removeToken() //不用管
 
-            next({ path: '/' })
-                // if (window.location.host.indexOf("localhost") != -1) {
-                //     next({ path: '/' })
-                // } else if (window.location.host.indexOf("pcdev.ewoogi.com") != -1) {
-                //     window.location.href = 'https://pcdev.ewoogi.com/adminfiv/#/login'
-                // } else {
-                //     window.location.href = 'https://wx.ewoogi.com/manage/#/login'
-                // }
+            if (window.location.host.indexOf("localhost") != -1) {
+                next({ path: '/' })
+                    // } else if (window.location.host.indexOf("pcdev.ewoogi.com") != -1) {
+                    //     window.location.href = 'https://pcdev.ewoogi.com/adminfiv/#/login'
+            } else {
+                window.location.href = 'http://101.133.214.75:13201/backStage'
+            }
 
             document.getElementById('routers').style.display = "none"
 

+ 5 - 6
src/utils/request.js

@@ -29,13 +29,12 @@ const handleCode = (code, msg) => {
             router
 
 
-            localStorage.removeItem('accessToken')
-            alert('进入登录页')
-            router.replace({ path: "/login" });
-            removeToken()
+            // localStorage.removeItem('accessToken')
+            // router.replace({ path: "/login" });
+
+            window.location.href = 'http://101.133.214.75:13201/backStage'
 
-            // window.location.href = 'https://wx.ewoogi.com/manage/#/login'
-            // removeToken()
+            removeToken()
 
             return;
     }

+ 6 - 6
src/views/login.vue

@@ -85,12 +85,12 @@ export default {
   mounted() {
     this.getCookie();
 
-    this.loginFree();
-    // if (window.location.host.indexOf("localhost") != -1) {
-    //   this.loginFree();
-    // } else {
-    //   this.$router.push({ path: "/home" });
-    // }
+    // this.loginFree();
+    if (window.location.host.indexOf("localhost") != -1) {
+      this.loginFree();
+    } else {
+      this.$router.push({ path: "/home" });
+    }
   },
 
   methods: {