From 1bc3af31066268415b431f035c87d82aa321dc01 Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期六, 15 三月 2025 09:57:28 +0800
Subject: [PATCH] 单点登录调整

---
 src/store/modules/user.js |   16 ++++++++++------
 src/main.js               |    4 +---
 src/router/index.js       |   12 ++++++++++++
 3 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/src/main.js b/src/main.js
index adbeaf1..aa78603 100644
--- a/src/main.js
+++ b/src/main.js
@@ -66,9 +66,7 @@
 Vue.prototype.HaveJson = (val) => {
   return JSON.parse(JSON.stringify(val));
 };
-Vue.prototype.javaApi = process.env.VUE_APP_BASE_API
-  ? process.env.VUE_APP_BASE_API
-  : "http://localhost:8001";
+Vue.prototype.javaApi = "http://114.132.189.42:7012";
 Vue.prototype.checkPermi = checkPermi;
 Vue.prototype.uploadHeader = {
   Authorization: "Bearer " + getToken(),
diff --git a/src/router/index.js b/src/router/index.js
index ccc0b3f..9d4db52 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -46,6 +46,18 @@
     component: () => import("@/views/login"),
     hidden: true,
   },
+  // 绗笁鏂圭櫥褰曢〉
+  {
+    path: "/thirdpartylogin",
+    component: () => import("@/views/thirdpartylogin"),
+    hidden: true,
+  },
+  // 绗笁鏂圭櫥褰曢〉涓浆
+  {
+    path: "/logindemo",
+    component: () => import("@/views/logindemo"),
+    hidden: true,
+  },
   {
     path: "/register",
     component: () => import("@/views/register"),
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 1fc3208..b02eb61 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -113,12 +113,16 @@
     LogOut({ commit, state }) {
       return new Promise((resolve, reject) => {
         logout(state.token)
-          .then(() => {
-            commit("SET_TOKEN", "");
-            commit("SET_ROLES", []);
-            commit("SET_PERMISSIONS", []);
-            removeToken();
-            resolve();
+          .then((res) => {
+            if (res.data) {
+              window.location.href = res.data
+            } else {
+              commit("SET_TOKEN", "");
+              commit("SET_ROLES", []);
+              commit("SET_PERMISSIONS", []);
+              removeToken();
+              resolve();
+            }
           })
           .catch((error) => {
             reject(error);

--
Gitblit v1.9.3