From 2671888e8977e3e84d29130f32f113bb8154d8e5 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期一, 02 九月 2024 11:26:38 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.11.205:9000/r/se-cloud

---
 se-ui/src/permission.js |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/se-ui/src/permission.js b/se-ui/src/permission.js
index c568979..b1eb0a7 100644
--- a/se-ui/src/permission.js
+++ b/se-ui/src/permission.js
@@ -16,7 +16,12 @@
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
     /* has token*/
     if (to.path === '/login') {
-      next({ path: '/' })
+      if (process.env.ENV = 'development') {
+        window.location.href = 'http://localhost:8080/login'
+      } else if (process.env.ENV = 'production') {
+        window.location.href = window.location.origin + '/sso/login'
+      }
+      // next({ path: '/' })
       NProgress.done()
     } else if (whiteList.indexOf(to.path) !== -1) {
       next()
@@ -32,11 +37,16 @@
             next({ ...to, replace: true }) // hack鏂规硶 纭繚addRoutes宸插畬鎴�
           })
         }).catch(err => {
-            store.dispatch('LogOut').then(() => {
-              Message.error(err)
-              next({ path: '/' })
-            })
+          store.dispatch('LogOut').then(() => {
+            Message.error(err)
+            if (process.env.ENV = 'development') {
+              window.location.href = 'http://localhost:8080/login'
+            } else if (process.env.ENV = 'production') {
+              window.location.href = window.location.origin + '/sso/login'
+            }
+            // next({ path: '/' })
           })
+        })
       } else {
         next()
       }
@@ -47,7 +57,11 @@
       // 鍦ㄥ厤鐧诲綍鐧藉悕鍗曪紝鐩存帴杩涘叆
       next()
     } else {
-      next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 鍚﹀垯鍏ㄩ儴閲嶅畾鍚戝埌鐧诲綍椤�
+      if (process.env.ENV = 'development') {
+        window.location.href = 'http://localhost:8080/login'
+      } else if (process.env.ENV = 'production') {
+        window.location.href = window.location.origin + '/sso/login'
+      }
       NProgress.done()
     }
   }

--
Gitblit v1.9.3