update 优化 !pr370 完成三方登录授权功能
This commit is contained in:
parent
3b4ac3e525
commit
7340997cf5
@ -74,9 +74,6 @@ export function socialLogin(source: string, code: any, state: any): AxiosPromise
|
||||
return request({
|
||||
url: '/auth/social-login/' + source,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isToken: true
|
||||
},
|
||||
params: data
|
||||
});
|
||||
}
|
||||
|
@ -4,10 +4,7 @@ import request from '@/utils/request';
|
||||
export function authBinding(source: string) {
|
||||
return request({
|
||||
url: '/auth/binding/' + source,
|
||||
method: 'get',
|
||||
headers: {
|
||||
isToken: true
|
||||
}
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
@ -15,19 +12,13 @@ export function authBinding(source: string) {
|
||||
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'
|
||||
});
|
||||
}
|
||||
|
@ -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();
|
@ -40,7 +40,7 @@ export const constantRoutes: RouteOption[] = [
|
||||
{
|
||||
path: '/social-login',
|
||||
hidden: true,
|
||||
component: () => import('@/layout/components/socialLogin/index.vue')
|
||||
component: () => import('@/layout/components/SocialLogin/index.vue')
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
|
@ -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')" />
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user