!16 扩展第三方登录授权功能

* add 第三方授权
* add 第三方授权登录
This commit is contained in:
三个三
2023-06-20 04:12:49 +00:00
committed by 疯狂的狮子Li
parent 41d140af11
commit aae6bb7505
10 changed files with 359 additions and 74 deletions

View File

@ -60,6 +60,24 @@ export function getCodeImg(): AxiosPromise<VerifyCodeResult> {
timeout: 20000
});
}
/**
* 第三方登录
* @param source 第三方登录类型
* */
export function socialLogin(source: string, code: any, state: any): AxiosPromise<any> {
const data = {
code,
state
};
return request({
url: '/auth/social-login/' + source,
method: 'get',
headers: {
isToken: true
},
params: data
});
}
// 获取用户详细信息
export function getInfo(): AxiosPromise<UserInfo> {

View File

@ -0,0 +1,33 @@
import request from '@/utils/request';
// 绑定账号
export function authBinding(source: string) {
return request({
url: '/auth/binding/' + source,
method: 'get',
headers: {
isToken: true
}
});
}
// 解绑账号
export function authUnlock(authId: string) {
return request({
url: '/auth/unlock/' + authId,
method: 'delete',
headers: {
isToken: true
}
});
}
//获取授权列表
export function getAuthList() {
return request({
url: '/system/social/list',
method: 'get',
headers: {
isToken: true
}
});
}