Files
certd/packages/ui/certd-client/src/views/framework/oauth/api.ts
T

54 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-11-27 01:59:22 +08:00
import { request } from "/src/api/service";
const apiPrefix = "/oauth";
export async function OauthLogin(type: string, forType?: string) {
2025-11-27 01:59:22 +08:00
return await request({
url: apiPrefix + `/login`,
method: "post",
data: {
type,
forType: forType || "login",
2025-11-27 01:59:22 +08:00
},
});
}
2025-11-28 01:42:42 +08:00
export async function OauthToken(type: string, validationCode: string) {
2025-11-27 01:59:22 +08:00
return await request({
2025-11-28 01:42:42 +08:00
url: apiPrefix + `/token`,
2025-11-27 01:59:22 +08:00
method: "post",
data: {
type,
2025-11-28 01:42:42 +08:00
validationCode,
2025-11-27 01:59:22 +08:00
},
});
}
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,
},
});
}
2025-11-28 01:42:42 +08:00
export async function GetOauthProviders() {
return await request({
url: apiPrefix + "/providers",
method: "post",
});
}