> For the complete documentation index, see [llms.txt](https://marcosteam.gitbook.io/sspanel-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://marcosteam.gitbook.io/sspanel-api/yong-hu-she-zhi/an-quan-she-zhi.md).

# 安全设置

以下 API 涉及用户的账户安全模块。

## sspwd

<mark style="color:green;">`POST`</mark> `/user/sspwd`

&#x20;重置用户的连接密码与 uuid 。

#### Path Parameters

| Name  | Type   | Description          |
| ----- | ------ | -------------------- |
| sspwd | string | 设置的密码，默认情况下建议为随机字符串。 |

{% tabs %}
{% tab title="200  修改成功" %}

```
{"ret":1}
```

{% endtab %}
{% endtabs %}

## password

<mark style="color:green;">`POST`</mark> `/user/password`

重置用户登录密码。

#### Request Body

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| oldpwd | string | 原密码         |
| pwd    | string | 新密码         |
| repwd  | string | 确认新密码       |

{% tabs %}
{% tab title="200 ret：用户密码重置状态
msg：状态消息" %}

```
{"ret":0,"msg":"\u4e24\u6b21\u8f93\u5165\u4e0d\u7b26\u5408"}
```

{% endtab %}
{% endtabs %}

## getnewsubtoken

<mark style="color:blue;">`GET`</mark> `/getnewsubtoken`

重置用户的订阅链接，include cookie。

{% tabs %}
{% tab title="200 返回新的订阅主 token 。" %}

```
{"arr":{"ssr_sub_token":"rnuf03nyPRi3glyJ"},"ret":1}
```

{% endtab %}
{% endtabs %}

以下为 OTP 两步认证部分：

## gacheck

<mark style="color:green;">`POST`</mark> `/user/gacheck`

检测输入的两步验证码是否有效

#### Request Body

| Name | Type   | Description |
| ---- | ------ | ----------- |
| code | number | 输入验证码       |

{% tabs %}
{% tab title="200 ret: 用户状态码，1 为成功，0 为失败。
msg：状态消息" %}

```
{"ret":0,"msg":"\u6d4b\u8bd5\u9519\u8bef"}
```

{% endtab %}
{% endtabs %}

## gaset

<mark style="color:green;">`POST`</mark> `/user/gaset`

设置 OTP 验证的开关&#x20;

#### Path Parameters

| Name   | Type   | Description                     |
| ------ | ------ | ------------------------------- |
| enable | number | <p>OTP 开关状态<br>0：关闭<br>1：开启</p> |

{% tabs %}
{% tab title="200 " %}

```
{"ret":1,"msg":"\u8bbe\u7f6e\u6210\u529f"}
```

{% endtab %}
{% endtabs %}

## gareset

<mark style="color:blue;">`GET`</mark> `/user/gareset`

&#x20;用于重新生成用户的两步验证二维码，include cookie。

{% tabs %}
{% tab title="302 " %}

```
```

{% endtab %}
{% endtabs %}
