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

# 登录咏唱引擎 ROUTER 会话

> POST /v1/router/auth/login 对用户进行认证，并设置一个会话 Cookie，用于咏唱引擎 ROUTER 的管理与数据面访问。

使用用户名与密码向咏唱引擎 ROUTER 认证。登录成功后会设置一个会话 Cookie，可用于后续对管理面与数据面的请求。

## 接口

```http theme={null}
POST /v1/router/auth/login
```

## 认证

无需认证。

## 请求体

<ParamField body="username" type="string" required>
  账户的用户名。
</ParamField>

<ParamField body="password" type="string" required>
  账户的密码。
</ParamField>

## 响应

<ResponseField name="id" type="string">
  已认证用户的唯一标识符。
</ResponseField>

<ResponseField name="username" type="string">
  已认证用户的用户名。
</ResponseField>

<ResponseField name="email" type="string | null">
  若已设置则为邮箱，否则为 null。
</ResponseField>

<ResponseField name="role" type="string">
  用户角色，例如 `"user"` 或 `"admin"`。
</ResponseField>

<ResponseField name="disabled" type="boolean">
  账户当前是否被禁用。
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://router.example.com:8080/v1/router/auth/login \
    -H "Content-Type: application/json" \
    -d '{"username":"alice","password":"secret123"}' \
    -c cookies.txt
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "user-abc123",
    "username": "alice",
    "email": "alice@example.com",
    "role": "user",
    "disabled": false
  }
  ```
</ResponseExample>
