Mangogo 营业厅Mangogo 营业厅
首页API 参考Skills插件

3.1 获取当前用户信息

GET/api/user/self

3.1 获取当前用户信息

获取当前用户信息

接口地址: GET /api/user/self

权限要求: 🔐 需要登录(User权限)

描述: 获取当前登录用户的详细信息

请求头:

token: {access_token}

请求头说明:

  • token (必填): JWT 访问令牌

兼容性说明:

  • 为向后兼容,也支持 Authorization: Bearer {access_token} 请求头

请求示例:

curl -X GET "https://your-domain.com/api/user/self" \  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

请求参数: 无

返回数据:

{  "success": true,  "message": "",  "data": {    "id": 1,    "username": "user1",    "display_name": "User One",    "role": 1,    "status": 1,    "email": "user@example.com",    "github_id": "",    "discord_id": "",    "oidc_id": "",    "wechat_id": "",    "telegram_id": "",    "group": "default",    "quota": 100000,    "used_quota": 50000,    "request_count": 100,    "aff_code": "abc123",    "aff_count": 5,    "aff_quota": 50000,    "aff_charged_count": 3,    "inviter_id": 0,    "linux_do_id": "",    "setting": "{}",    "stripe_customer": "",    "sidebar_modules": {},    "permissions": {},    "avatar_url": "",    "phone": "",    "profit_quota": 0,    "aff_history_count": 5,    "aff_history": 100000,    "has_password": true,    "creation_num": 12,    "quota_usd": 0.2,    "used_quota_usd": 0.1,    "aff_quota_usd": 0.1,    "aff_history_usd": 0.2,    "profit_quota_usd": 0.0  }}

返回字段说明:

字段类型说明
idint用户ID
usernamestring用户名
display_namestring显示名称
roleint用户角色(1=普通用户,10=管理员,100=超级管理员)
statusint用户状态(1=启用,2=禁用)
emailstring邮箱
github_idstringGitHub ID
discord_idstringDiscord ID
oidc_idstringOIDC ID
wechat_idstring微信ID
telegram_idstringTelegram ID
groupstring用户分组
quotaint剩余配额
used_quotaint已使用配额
request_countint请求次数
aff_codestring推荐码
aff_countint推荐人数(邀请用户已注册数量)
aff_quotaint推荐奖励配额(剩余可转出的额度)
aff_historyint历史推荐总数(累计获得的邀请奖励配额总额)
aff_history_countint总共发起邀请连接次数
aff_charged_countint已充值邀请人数
inviter_idint邀请人ID
linux_do_idstringLinuxDo ID
settingstring用户设置JSON
stripe_customerstringStripe客户ID
sidebar_modulesobject侧边栏模块配置
permissionsobject用户权限信息
avatar_urlstring头像URL
phonestring手机号
profit_quotaint累计收益配额
has_passwordboolean是否设置密码(true=已设置,false=未设置)
creation_numint用户作品数量,统计 creation_info 表中当前用户 deleted=0 的记录总数
quota_usdfloat剩余配额(USD),通过 quota / QuotaPerUnit 换算
used_quota_usdfloat已使用配额(USD),通过 used_quota / QuotaPerUnit 换算
aff_quota_usdfloat推荐奖励配额(USD),通过 aff_quota / QuotaPerUnit 换算
aff_history_usdfloat历史推荐总数(USD),通过 aff_history / QuotaPerUnit 换算
profit_quota_usdfloat累计收益配额(USD),通过 profit_quota / QuotaPerUnit 换算