From 6e3aec7c50c1dadcbbafbd5f04880f5395480f67 Mon Sep 17 00:00:00 2001
From: thiszhc <2029364173@qq.com>
Date: 星期六, 01 七月 2023 15:05:48 +0800
Subject: [PATCH] 对接后端更改做了适配,

---
 src/layout/components/SocialLogin/index.vue |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/layout/components/SocialLogin/index.vue b/src/layout/components/SocialLogin/index.vue
index 82fb253..5c04df5 100644
--- a/src/layout/components/SocialLogin/index.vue
+++ b/src/layout/components/SocialLogin/index.vue
@@ -21,7 +21,6 @@
 const state = route.query.state;
 const source = route.query.source as string;
 const tenantId = Cookies.get("tenantId") ? Cookies.get("tenantId") as string : '000000';
-const loginType = getToken() ? 'register' : 'login';
 
 /**
  * 閫氳繃code鑾峰彇token
@@ -29,7 +28,7 @@
  * @param {string} code
  * @param {string} state
  */
-await socialLogin(source, tenantId, loginType, code, state)
+await socialLogin(source, tenantId, code, state)
   .then(async (res) => {
     if (res.code !== 200) {
       ElMessage.error(res.msg);
@@ -37,10 +36,9 @@
       return;
     }
     loading.value = false;
-    // setToken(res.msg);
-    loginType === 'login' ? setToken(res.data) : ElMessage.success(res.msg);
+    setToken(res.data.access_token)
+    ElMessage.success(res.msg);
     location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
-
   })
   .catch(() => {
     loading.value = false;

--
Gitblit v1.9.3