# 用户接口

# GET /api/v1/auth/me

功能: 获取当前用户信息

响应示例:

{
  "success": true,
  "data": {
    "user": {
      "id": "user_id_123",
      "username": "test_user",
      "email": "test@example.com",
      "avatar": "https://example.com/avatar.jpg",
      "tenant_id": 10001,
      "is_active": true,
      "can_access_all_tenants": false,
      "created_at": "2026-02-28T16:29:08+08:00",
      "updated_at": "2026-03-02T11:52:04+08:00"
    },
    "tenant": {
      "id": 10001,
      "name": "测试租户",
      "description": "租户描述信息",
      "api_key": "api-key-value",
      "status": "active",
      "retriever_engines": {
        "engines": []
      },
      "business": "企业业务",
      "storage_quota": 10737418240,
      "storage_used": 1048576,
      "agent_config": null,
      "context_config": null,
      "web_search_config": null,
      "conversation_config": null,
      "created_at": "2026-02-28T16:29:08+08:00",
      "updated_at": "2026-03-02T11:52:04+08:00",
      "deleted_at": null
    }
  }
}

响应格式说明:

字段名 类型 说明
success boolean 请求是否成功
data object 响应数据
data.user object 用户信息
data.user.id string 用户ID
data.user.username string 用户名
data.user.email string 邮箱地址
data.user.avatar string 头像URL
data.user.tenant_id integer 租户ID
data.user.is_active boolean 是否激活
data.user.can_access_all_tenants boolean 是否可以访问所有租户
data.user.created_at string 创建时间
data.user.updated_at string 更新时间
data.tenant object/null 租户信息(如果用户有租户)
data.tenant.id integer 租户ID
data.tenant.name string 租户名称
data.tenant.description string 租户描述
data.tenant.api_key string API密钥
data.tenant.status string 租户状态
data.tenant.retriever_engines object 检索引擎配置
data.tenant.business string 业务类型
data.tenant.storage_quota integer 存储配额(字节)
data.tenant.storage_used integer 已使用存储(字节)
data.tenant.agent_config object/null 代理配置
data.tenant.context_config object/null 上下文配置
data.tenant.web_search_config object/null 网络搜索配置
data.tenant.conversation_config object/null 对话配置
data.tenant.created_at string 创建时间
data.tenant.updated_at string 更新时间
data.tenant.deleted_at string/null 删除时间