Files
certd/packages/ui/certd-client/src/views/framework/oauth/api.ts
T
2026-05-14 01:39:22 +08:00

56 lines
1.1 KiB
TypeScript

import { request } from "/src/api/service";
const apiPrefix = "/oauth";
export async function OauthLogin(type: string, forType?: string, from?: string, subtype?: string) {
return await request({
url: apiPrefix + `/login`,
method: "post",
data: {
type,
forType: forType || "login",
from: from || "web",
subtype,
},
});
}
export async function OauthToken(type: string, validationCode: string) {
return await request({
url: apiPrefix + `/token`,
method: "post",
data: {
type,
validationCode,
},
});
}
export async function AutoRegister(type: string, code: string) {
return await request({
url: apiPrefix + `/autoRegister`,
method: "post",
data: {
validationCode: code,
type,
},
});
}
export async function BindUser(code: string) {
return await request({
url: apiPrefix + `/bind`,
method: "post",
data: {
validationCode: code,
},
});
}
export async function GetOauthProviders() {
return await request({
url: apiPrefix + "/providers",
method: "post",
});
}