update 优化 !pr370 完成三方登录授权功能
| | |
| | | return request({ |
| | | url: '/auth/social-login/' + source, |
| | | method: 'get', |
| | | headers: { |
| | | isToken: true |
| | | }, |
| | | params: data |
| | | }); |
| | | } |
| | |
| | | export function authBinding(source: string) { |
| | | return request({ |
| | | url: '/auth/binding/' + source, |
| | | method: 'get', |
| | | headers: { |
| | | isToken: true |
| | | } |
| | | method: 'get' |
| | | }); |
| | | } |
| | | |
| | |
| | | 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' |
| | | }); |
| | | } |
ÎļþÃû´Ó src/layout/components/socialLogin/index.vue ÐÞ¸Ä |
| | |
| | | </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(); |
| | |
| | | { |
| | | path: '/social-login', |
| | | hidden: true, |
| | | component: () => import('@/layout/components/socialLogin/index.vue') |
| | | component: () => import('@/layout/components/SocialLogin/index.vue') |
| | | }, |
| | | { |
| | | path: '/login', |
| | |
| | | </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')" /> |
| | |
| | | <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> |