---
title: "用户登录"
method: POST
path: "/auth/login"
tags: ["认证"]
---

# 用户登录

`POST /auth/login`

用户登录并获取JWT令牌

## Request body

- DtoUserLoginRequest
  - `password` string, required
  - `username` string, required

## Response `200`

登录成功

- object — 成功的API响应标准格式
  - `code` integer
  - `data` DtoLoginResponseData
    - `token` string — JWT token
    - `user` ModelUser
      - `createdAt` string
      - `id` string
      - `lastLogin` string
      - `needReset` boolean — 是否需要重置密码
      - `permissions` string[] — 额外权限
      - `role` string — 用户角色
      - `updatedAt` string
      - `username` string
  - `message` string
  - `requestId` string
  - `success` boolean
  - `timestamp` string

## Other responses

- `400` — 请求参数错误
- `401` — 用户名或密码错误
- `500` — 服务器内部错误

---

[API](https://skmtc.net/labring/apis/ruiqi-waf-api.md) · [All operations](https://skmtc.net/labring/apis/ruiqi-waf-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/labring/ruiqi-waf-api/revisions/aaacd7e06a88/schema)
