[comment]: # translation:outdated

[comment]: # ({9773f653-4af7a213})
# 重置TOTP

[comment]: # ({/9773f653-4af7a213})

[comment]: # ({2f760ecf-1d5cf984})
### 描述

`object user.resettotp(object/array users)`

此方法允许重置用户TOTP密码。

::: noteclassic
此方法仅适用于*Super admin(超级管理员)*类型的用户。可在用户角色设置中撤销调用该方法的权限，参阅[用户角色](/manual/web_interface/frontend_sections/users/user_roles)获取详情。
:::

[comment]: # ({/2f760ecf-1d5cf984})

[comment]: # ({c8b7ac78-eed4792f})

### 参数

`(array)` 要重置 TOTP 密码的用户的 ID。

::: noteclassic
指定用户的用户会话也将被删除（发送请求的用户除外）。
:::

[comment]: # ({/c8b7ac78-eed4792f})

[comment]: # ({261f8ac9-664dd395})

### 返回值

`(object)` 此函数返回一个对象，该对象在其`userids`属性下包含了已重置TOTP密钥的用户ID。

[comment]: # ({/261f8ac9-664dd395})

[comment]: # ({b41637d2-40f7edfd})
### 示例

[comment]: # ({/b41637d2-40f7edfd})

[comment]: # ({f5ef228d-9fb090fd})

#### 批量重置用户TOTP密钥

为两个用户重置TOTP密钥。

[请求](/manual/api#执行请求):

```json
{
    "jsonrpc": "2.0",
    "method": "user.resettotp",
    "params": [
        "1",
        "5"
    ],
    "id": 1
}
```

响应:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "userids": [
            "1",
            "5"
        ]
    },
    "id": 1
}
```

[comment]: # ({/f5ef228d-9fb090fd})

[comment]: # ({5bd16955-0c80b38e})
### 参考

-   [MFA 对象](/manual/api/reference/mfa/object)

[comment]: # ({/5bd16955-0c80b38e})

[comment]: # ({646dbdd5-5ddc468d})
### 来源

CUser::resettotp() in *ui/include/classes/api/services/CUser.php*.

[comment]: # ({/646dbdd5-5ddc468d})
