From 40e3bcb3913994a11bac19ff4e562e7df726884f Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期二, 20 六月 2023 15:00:29 +0800
Subject: [PATCH] update 优化 !pr370 完成三方登录授权功能

---
 src/views/login.vue                          |    4 ++--
 src/layout/components/SocialLogin/index.vue  |    4 ++--
 src/api/login.ts                             |    3 ---
 src/router/index.ts                          |    2 +-
 src/views/system/user/profile/thirdParty.vue |    4 ++--
 src/api/system/social/auth.ts                |   15 +++------------
 6 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/src/api/login.ts b/src/api/login.ts
index 48b62d1..9d6d1b7 100644
--- a/src/api/login.ts
+++ b/src/api/login.ts
@@ -72,9 +72,6 @@
   return request({
     url: '/auth/social-login/' + source,
     method: 'get',
-    headers: {
-      isToken: true
-    },
     params: data
   });
 }
diff --git a/src/api/system/social/auth.ts b/src/api/system/social/auth.ts
index b1f2106..17a46d3 100644
--- a/src/api/system/social/auth.ts
+++ b/src/api/system/social/auth.ts
@@ -4,10 +4,7 @@
 export function authBinding(source: string) {
   return request({
     url: '/auth/binding/' + source,
-    method: 'get',
-    headers: {
-      isToken: true
-    }
+    method: 'get'
   });
 }
 
@@ -15,19 +12,13 @@
 export function authUnlock(authId: string) {
   return request({
     url: '/auth/unlock/' + authId,
-    method: 'delete',
-    headers: {
-      isToken: true
-    }
+    method: 'delete'
   });
 }
 //鑾峰彇鎺堟潈鍒楄〃
 export function getAuthList() {
   return request({
     url: '/system/social/list',
-    method: 'get',
-    headers: {
-      isToken: true
-    }
+    method: 'get'
   });
 }
diff --git a/src/layout/components/socialLogin/index.vue b/src/layout/components/SocialLogin/index.vue
similarity index 89%
rename from src/layout/components/socialLogin/index.vue
rename to src/layout/components/SocialLogin/index.vue
index e125c12..fad8286 100644
--- a/src/layout/components/socialLogin/index.vue
+++ b/src/layout/components/SocialLogin/index.vue
@@ -3,8 +3,8 @@
 </template>
 
 <script setup lang="ts">
-import { socialLogin } from '@/api/login';
-import { setToken } from '@/utils/auth';
+import {socialLogin} from '@/api/login';
+import {setToken} from '@/utils/auth';
 
 const route = useRoute();
 const router = useRouter();
diff --git a/src/router/index.ts b/src/router/index.ts
index 33e3e5e..76a81bc 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -40,7 +40,7 @@
   {
     path: '/social-login',
     hidden: true,
-    component: () => import('@/layout/components/socialLogin/index.vue')
+    component: () => import('@/layout/components/SocialLogin/index.vue')
   },
   {
     path: '/login',
diff --git a/src/views/login.vue b/src/views/login.vue
index af98f01..9becbc3 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -38,10 +38,10 @@
       </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')" />
+          <svg-icon icon-class="qq" @click="doSocialLogin('qq')" />
         </el-button>
         <el-button circle>
-          <svg-icon icon-class="wechat" @click="doSocialLogin('Wechat')" />
+          <svg-icon icon-class="wechat" @click="doSocialLogin('wechat')" />
         </el-button>
         <el-button circle>
           <svg-icon icon-class="gitee" @click="doSocialLogin('gitee')" />
diff --git a/src/views/system/user/profile/thirdParty.vue b/src/views/system/user/profile/thirdParty.vue
index 51c8ba8..e5791ef 100644
--- a/src/views/system/user/profile/thirdParty.vue
+++ b/src/views/system/user/profile/thirdParty.vue
@@ -34,14 +34,14 @@
           <span class="app-name">Github</span>
         </a>
 
-        <a class="third-app" href="#" title="鍔熻兘寮�鍙戜腑...">
+        <a class="third-app" href="#" @click="authUrl('wechar');" title="浣跨敤 寰俊 璐﹀彿鎺堟潈鐧诲綍">
           <div class="git-other-login-icon">
             <svg-icon icon-class="wechat" />
           </div>
           <span class="app-name">WeiXin</span>
         </a>
 
-        <a class="third-app" href="#" title="鍔熻兘寮�鍙戜腑...">
+        <a class="third-app" href="#" @click="authUrl('qq');" title="浣跨敤 QQ 璐﹀彿鎺堟潈鐧诲綍">
           <div class="git-other-login-icon">
             <svg-icon icon-class="qq" />
           </div>

--
Gitblit v1.9.3