Module: AuthAPI

包含与用户认证相关的 API 请求。
Source:

Methods

(inner) fetchCaptcha() → {Promise.<FetchCaptchaResponse>}

获得图形验证码。
Source:
Returns:
包含图形验证码 SVG 和可能 ID 的 Promise 对象。
Type
Promise.<FetchCaptchaResponse>

(inner) loginByPhone(data) → {Promise.<object>}

使用手机号登录。
Parameters:
Name Type Description
data LoginByPhoneRequest 请求体数据,包含手机号和可选的短信验证码或密码。
Source:
Returns:
包含登录结果(包括 Token)的 Promise 对象。
Type
Promise.<object>

(inner) loginByUsername(data) → {Promise.<object>}

使用用户名登录。
Parameters:
Name Type Description
data LoginByUsernameRequest 请求体数据,包含用户名和密码。
Source:
Returns:
包含登录结果(包括 Token)的 Promise 对象。
Type
Promise.<object>

(inner) registerUser(data) → {Promise.<object>}

注册新用户。
Parameters:
Name Type Description
data RegisterRequest 请求体数据,包含手机号、短信验证码、用户名和密码。
Source:
Returns:
包含注册结果的 Promise 对象。
Type
Promise.<object>

(inner) resetPassword(data) → {Promise.<object>}

重设密码。
Parameters:
Name Type Description
data ResetPasswordRequest 请求体数据,包含新密码、手机号和验证码。
Source:
Returns:
包含重设密码结果的 Promise 对象。
Type
Promise.<object>

(inner) sendSmsCode(data) → {Promise.<object>}

发送短信验证码。
Parameters:
Name Type Description
data SendSmsCodeRequest 请求体数据,包含手机号和图形验证码。
Source:
Returns:
包含短信发送结果的 Promise 对象。
Type
Promise.<object>

Type Definitions

FetchCaptchaResponse

Type:
  • object
Properties:
Name Type Description
svg string 图形验证码的 SVG 字符串。
captchaId string 验证码ID,可能用于后续验证。
Source:

LoginByPhoneRequest

Type:
  • object
Properties:
Name Type Attributes Description
phoneNumber string 手机号码。
code string <optional>
短信验证码(可选,与密码二选一)。
password string <optional>
密码(可选,与短信验证码二选一)。
Source:

LoginByUsernameRequest

Type:
  • object
Properties:
Name Type Description
username string 用户名。
password string 密码。
Source:

RegisterRequest

Type:
  • object
Properties:
Name Type Description
phoneNumber string 手机号码。
code string 短信验证码。
username string 用户名。
password string 密码。
Source:

ResetPasswordRequest

Type:
  • object
Properties:
Name Type Description
newPwd string 新密码。
phoneNumber string 手机号码。
code string 手机验证码。
Source:

SendSmsCodeRequest

Type:
  • object
Properties:
Name Type Description
phone string 用户手机号。
captcha string 图形验证码。
Source: