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

# 用户登录

`POST /auth/login`

用户登录获取访问令牌

## Request body

- ModelsLoginRequest
  - `password` string, required — 密码
  - `username` string, required — 用户名

## Response `200`

登录成功

- ModelsLoginResponse
  - `access_token` string — Access Token
  - `expires_in` integer — Access Token 过期时间（秒）
  - `refresh_token` string — Refresh Token
  - `token_type` string — Token 类型

## Other responses

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

---

[API](https://skmtc.net/songloft-org/apis/songloft-api.md) · [All operations](https://skmtc.net/songloft-org/apis/songloft-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/songloft-org/songloft-api/versions/ee41778dbf8f/schema)
