You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.2 KiB
TypeScript
62 lines
1.2 KiB
TypeScript
declare namespace API {
|
|
// OAuth 登录请求(网页登录)
|
|
interface OauthLoginReq {
|
|
// 服务提供商名称
|
|
provider: string
|
|
}
|
|
|
|
// OAuth 登录返回登录页(网页登录)
|
|
interface OauthLoginResp {
|
|
// 提供商登录地址
|
|
AuthUrl: string
|
|
}
|
|
|
|
// OAuth Code 登录请求
|
|
interface OauthLoginByCodeReq {
|
|
code: string
|
|
provider: string
|
|
}
|
|
|
|
// OAuth 手机号登录请求
|
|
interface OauthLoginByPhoneCodeReq {
|
|
authCode?: string
|
|
code: string
|
|
provider: string
|
|
}
|
|
|
|
// 登录请求
|
|
type LoginReq = Partial<CaptchaReq> & {
|
|
// 登录主体(用户名/邮箱/手机号码)| 作用于验证码时,不支持用户名
|
|
subject: string
|
|
// 登录凭证
|
|
credentials: string
|
|
// 当前登录平台
|
|
platform: string
|
|
}
|
|
|
|
// 登录Token信息
|
|
interface LoginTokenInfo {
|
|
uid: string
|
|
token_type: string
|
|
access_token: string
|
|
expires_at: number
|
|
scope: string
|
|
}
|
|
|
|
// 登录返回
|
|
interface LoginResp {
|
|
twoFactorType: string
|
|
token: LoginTokenInfo
|
|
}
|
|
|
|
// 注册请求
|
|
type RegisterReq = Partial<CaptchaReq> & Partial<{
|
|
username: string
|
|
email: string
|
|
phoneNumber: string
|
|
code: string
|
|
}> & {
|
|
credentials: string
|
|
}
|
|
}
|