# 8. 登录

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /auth/v1.pub/login:
    post:
      summary: 8. 登录
      deprecated: false
      description: ''
      tags:
        - admin 👨‍💻/auth/v1/Pub
        - admin
      parameters:
        - name: X-Client
          in: header
          description: ''
          required: true
          example: '{{x_client}}'
          schema:
            type: string
        - name: X-ApifoxUser
          in: header
          description: ''
          required: true
          example: '{{apifox_user}}'
          schema:
            type: string
        - name: X-Time
          in: header
          description: ''
          required: true
          example: '{{timestamp}}'
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  description: 登录登录名（name/mobile/email 用户名/手机号码/邮箱）
                  example: admin
                  type: string
                pwd:
                  description: 登录密码
                  example: '123456'
                  type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    x-apifox-orders: []
                  msg:
                    type: string
                  code:
                    type: integer
                required:
                  - data
                  - msg
                  - code
                x-apifox-orders:
                  - data
                  - msg
                  - code
              examples:
                '1':
                  summary: success
                  value:
                    data:
                      token: eyJ0eXAiOiJKV1
                      nick_name: dsff
                      avatar: eyJ0eXAiOiJKV1
                    msg: ''
                    code: 1
                '2':
                  summary: error
                  value:
                    data: []
                    msg: 管理员不存在
                    code: 0
          headers: {}
          x-apifox-name: ok
      security: []
      x-apifox-folder: admin 👨‍💻/auth/v1/Pub
      x-apifox-status: developing
      x-run-in-apifox: https://app.apifox.com/web/project/2493394/apis/api-70864109-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: http://admin.api.test.domain.cn
    description: 测试环境
security: []

```
