> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acturehub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 账号密码登录

> 用户登录接口（带速率限制）。



## OpenAPI

````yaml /specs/bp-agent-account.openapi.json post /api/auth/login
openapi: 3.1.0
info:
  title: BP-Agent Account API
  description: BP-Agent 账号接口：项目导入与重复复用、N1 打标及项目卡读取。除登录和刷新外，接口使用账号 JWT 鉴权。
  contact:
    name: BP Agent 开发团队
    email: support@bpagent.com
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: 1.0.0
servers:
  - url: https://bptest.mapleai.cc
    description: 测试环境（仅 relay 上传）
  - url: https://project.mapleai.cc
    description: 生产环境（OSS；STS 直传需服务端启用）
security: []
paths:
  /api/auth/login:
    post:
      tags:
        - 认证授权 / Authentication
      summary: 账号密码登录
      description: 用户登录接口（带速率限制）。
      operationId: login_endpoint_api_auth_login_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserLogin'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse_LoginResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UserLogin:
      properties:
        account:
          type: string
          title: Account
          description: 账号（邮箱/手机号/用户名）
        password:
          type: string
          title: Password
          description: 密码
      type: object
      required:
        - account
        - password
      title: UserLogin
    SuccessResponse_LoginResponse_:
      properties:
        code:
          type: integer
          title: Code
          description: 响应码，成功时为0
          default: 0
        message:
          type: string
          title: Message
          description: 成功消息
          default: 操作成功
        data:
          $ref: '#/components/schemas/LoginResponse'
          description: 响应数据
        timestamp:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timestamp
          description: 响应时间戳（可选）
      type: object
      title: SuccessResponse[LoginResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LoginResponse:
      properties:
        access_token:
          type: string
          title: Access Token
          description: 访问令牌
        refresh_token:
          type: string
          title: Refresh Token
          description: 刷新令牌
        token_type:
          type: string
          title: Token Type
          description: 令牌类型
          default: bearer
        user:
          $ref: '#/components/schemas/UserResponse'
          description: 用户信息
      type: object
      required:
        - access_token
        - refresh_token
        - user
      title: LoginResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    UserResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: 用户ID
        tenant_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Tenant Id
          description: 租户ID（系统管理员为空）
        tenant_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tenant Name
          description: 租户名称
        username:
          type: string
          title: Username
          description: 用户名
        email:
          type: string
          title: Email
          description: 邮箱
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
          description: 手机号
        full_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Full Name
          description: 全名
        role:
          type: string
          title: Role
          description: 角色
        is_active:
          type: boolean
          title: Is Active
          description: 是否激活
        last_login_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Login At
          description: 最后登录时间
        created_at:
          type: string
          title: Created At
          description: 创建时间
      type: object
      required:
        - id
        - username
        - email
        - role
        - is_active
        - created_at
      title: UserResponse

````