Jelajahi Sumber

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

ming 3 tahun lalu
induk
melakukan
1f7f3b29c4
9 mengubah file dengan 18 tambahan dan 20 penghapusan
  1. TEMPAT SAMPAH
      dist.zip
  2. TEMPAT SAMPAH
      dist1.zip
  3. TEMPAT SAMPAH
      dist2.zip
  4. TEMPAT SAMPAH
      dist3.zip
  5. TEMPAT SAMPAH
      dist4.zip
  6. TEMPAT SAMPAH
      dist5.zip
  7. 7 8
      src/main.js
  8. 5 6
      src/utils/request.js
  9. 6 6
      src/views/login.vue

TEMPAT SAMPAH
dist.zip


TEMPAT SAMPAH
dist1.zip


TEMPAT SAMPAH
dist2.zip


TEMPAT SAMPAH
dist3.zip


TEMPAT SAMPAH
dist4.zip


TEMPAT SAMPAH
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: {