From 75e72bf974fdab85a81845f900f7fc17a9cb0126 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期四, 13 七月 2023 16:19:29 +0800
Subject: [PATCH] update 优化 三方授权页面 延迟跳转避免无法查看错误信息

---
 src/views/login.vue |   41 ++++++++++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/src/views/login.vue b/src/views/login.vue
index 709b0ce..365af12 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -27,6 +27,20 @@
         </div>
       </el-form-item>
       <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">璁颁綇瀵嗙爜</el-checkbox>
+      <el-form-item style="float: right;">
+        <el-button circle title="寰俊鐧诲綍">
+          <svg-icon icon-class="wechat" @click="doSocialLogin('wechat')" />
+        </el-button>
+        <el-button circle title="MaxKey鐧诲綍">
+          <svg-icon icon-class="maxkey" @click="doSocialLogin('maxkey')" />
+        </el-button>
+        <el-button circle title="Gitee鐧诲綍">
+          <svg-icon icon-class="gitee" @click="doSocialLogin('gitee')" />
+        </el-button>
+        <el-button circle title="Github鐧诲綍">
+          <svg-icon icon-class="github" @click="doSocialLogin('github')" />
+        </el-button>
+      </el-form-item>
       <el-form-item style="width:100%;">
         <el-button :loading="loading" size="large" type="primary" style="width:100%;" @click.prevent="handleLogin">
           <span v-if="!loading">鐧� 褰�</span>
@@ -36,20 +50,6 @@
           <router-link class="link-type" :to="'/register'">绔嬪嵆娉ㄥ唽</router-link>
         </div>
       </el-form-item>
-      <div style="display: flex;justify-content: flex-end;flex-direction: row;">
-        <el-button circle>
-          <svg-icon icon-class="qq" @click="doSocialLogin('qq')" />
-        </el-button>
-        <el-button circle>
-          <svg-icon icon-class="wechat" @click="doSocialLogin('wechat')" />
-        </el-button>
-        <el-button circle>
-          <svg-icon icon-class="gitee" @click="doSocialLogin('gitee')" />
-        </el-button>
-        <el-button circle>
-          <svg-icon icon-class="github" @click="doSocialLogin('github')" />
-        </el-button>
-      </div>
     </el-form>
     <!--  搴曢儴  -->
     <div class="el-login-footer">
@@ -72,7 +72,7 @@
 const router = useRouter();
 
 const loginForm = ref<LoginData>({
-  tenantId: "000000",
+  tenantId: '000000',
   username: 'admin',
   password: 'admin123',
   rememberMe: false,
@@ -176,6 +176,12 @@
     }
   }
 }
+
+//妫�娴嬬鎴烽�夋嫨妗嗙殑鍙樺寲
+watch(() => loginForm.value.tenantId, (val: string) => {
+  Cookies.set("tenantId", loginForm.value.tenantId, { expires: 30 })
+});
+
 /**
  * 绗笁鏂圭櫥褰�
  * @param type
@@ -183,8 +189,9 @@
 const doSocialLogin = (type: string) => {
   authBinding(type).then((res: any) => {
     if (res.code === HttpStatus.SUCCESS) {
-      window.location.href = res.msg;
-  } else {
+      // 鑾峰彇鎺堟潈鍦板潃璺宠浆
+      window.location.href = res.data;
+    } else {
       ElMessage.error(res.msg);
     }
   });

--
Gitblit v1.9.3