Module: UserAPI

包含用户账户信息和操作相关的 API 请求。
Source:

Methods

(inner) deleteUser() → {Promise.<object>}

删除用户。
Source:
Returns:
包含用户删除操作结果的 Promise 对象。
Type
Promise.<object>

(inner) getUserInfo() → {Promise.<object>}

获取用户信息。
Source:
Returns:
包含用户详细信息(如 ID、用户名、头像等)的 Promise 对象。
Type
Promise.<object>

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

更新用户信息。
Parameters:
Name Type Description
data UpdateUserInfoPayload 请求体数据,包含要更新的用户名和手机号码。
Source:
Returns:
包含用户信息更新结果的 Promise 对象。
Type
Promise.<object>

(inner) uploadUserAvatar(avatar) → {Promise.<object>}

更新用户头像。
Parameters:
Name Type Description
avatar FormData 包含头像文件(字段名为 'avatar')的 FormData 对象。
Source:
Returns:
包含头像上传结果和新头像 URL 的 Promise 对象。
Type
Promise.<object>

Type Definitions

UpdateUserInfoPayload

Type:
  • object
Properties:
Name Type Attributes Description
username string 用户名。
phoneNumber string 手机号码(中国格式)。
avatar string <optional>
头像 URL (Swagger中被标记为 required,但这里可能指通过其他API更新后的URL)。
Source:

UserAvatarUploadPayload

Type:
  • object
Properties:
Name Type Description
avatar FormData 包含头像文件(字段名为 'avatar')的 FormData 对象。
Source:

UserInfoResponseData

Type:
  • object
Properties:
Name Type Attributes Description
_id string 用户ID。
username string 用户名。
avatar string <optional>
用户头像URL。
phoneNumber string 手机号码。
favoriteGames Array.<string> <optional>
收藏的游戏列表(可选)。
groups Array.<string> <optional>
所属群组列表(可选)。
Source: