From afa8ee521affdce4f4cac9ba32ede9d22b76a13e Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 27 Sep 2022 09:54:30 +0800
Subject: [PATCH] 还原之前更改,用户登录跳转到统一登陆页面

---
 src/page/login/authredirect.vue |    3 +--
 src/router/axios.js             |    3 +--
 src/page/login/userlogin.vue    |    8 ++++++--
 src/page/lock/index.vue         |    3 +--
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/page/lock/index.vue b/src/page/lock/index.vue
index 44467f3..26cb451 100644
--- a/src/page/lock/index.vue
+++ b/src/page/lock/index.vue
@@ -49,8 +49,7 @@
         type: "warning"
       }).then(() => {
         this.$store.dispatch("LogOut").then(() => {
-          // this.$router.push({ path: "/login" });
-          window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
+          this.$router.push({ path: "/login" });
         });
       });
     },
diff --git a/src/page/login/authredirect.vue b/src/page/login/authredirect.vue
index edc61db..15cbce1 100644
--- a/src/page/login/authredirect.vue
+++ b/src/page/login/authredirect.vue
@@ -10,8 +10,7 @@
     const params = this.$route.query
     const state = params.state
     const code = params.code
-    // window.opener.location.href = `${window.location.origin}/#/login?state=${state}&code=${code}`
-    window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
+    window.opener.location.href = `${window.location.origin}/#/login?state=${state}&code=${code}`
   }
 }
 </script>
diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index 2a1c180..d7bfa9e 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -169,14 +169,18 @@
     created() {
       this.getTenant();
       this.refreshCode();
-    },
-    mounted() {
       //统一登录有没有登录
       const token = window.sessionStorage.getItem('token')
       if (token) {
         this.loginInfoByToken();
+      }else{
+        //跳转到本地登录页时跳转到统一登录
+        window.location.replace('http://dev.jxpskj.com:8020/ncny/login.html')
       }
     },
+    mounted() {
+      
+    },
     watch: {
       'loginForm.deptId'() {
         const column = this.findObject(this.userOption.column, "deptId");
diff --git a/src/router/axios.js b/src/router/axios.js
index f2ced43..0d0f879 100644
--- a/src/router/axios.js
+++ b/src/router/axios.js
@@ -68,8 +68,7 @@
   if (statusWhiteList.includes(status)) return Promise.reject(res);
   //如果是401则跳转到登录页面
   if (status === 401) store.dispatch('FedLogOut').then(() => 
-    // router.push({path: '/login'})
-    window.opener.location.href = 'http://dev.jxpskj.com:8020/ncny/login.html'
+    router.push({path: '/login'})
   );
   // 如果请求为非200否者默认统一处理
   if (status !== 200) {

--
Gitblit v1.9.3