Appearance
用户注册 POST
注册新的用户账号。
请求方法:
POSTContent-Type:application/x-www-form-urlencoded
💡 SDK 快速接入
官方 SDK 已支持此接口,您可以直接使用 SDK 一键调用,无需手动处理加密和签名。
SDK 调用示例
python
result = verify.user_register('username', 'password', 'email@example.com')
if result['success']:
print("注册成功")javascript
const result = await verify.userRegister('username', 'password', 'email@example.com');
if (result.success) console.log('注册成功');java
T3Verify.T3Result result = verify.userRegister("username", "password", "email@example.com");
if (result.success) System.out.println("注册成功");csharp
var result = verify.UserRegister("username", "password", "email@example.com");
if (result.Success) Console.WriteLine("注册成功");php
$result = $verify->userRegister('username', 'password', 'email@example.com');
if ($result['success']) echo "注册成功\n";请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
user | string | 必填 | 用户名(≥ 6 位,仅限英文和数字) |
pass | string | 必填 | 密码(≥ 6 位,不可与用户名相同) |
email | string | 条件必填 | 邮箱地址(后台开启邮箱时必填) |
t | number | 条件必填 | 秒级 Unix 时间戳 |
s | string | 条件必填 | 请求签名 |
safe_code | string | 可选 | 数据验证码 |
成功响应
jsonc
{
"code": "200", // 状态码
"msg": "注册成功" // 结果消息
}txt
注册成功错误列表
业务错误
| 错误消息 | 原因 |
|---|---|
用户名不可为空 | 未传 user |
密码不可为空 | 未传 pass |
用户名只能为英文或数字 | 用户名包含非法字符 |
用户名不可低于6位 | 用户名长度 < 6 |
密码不可低于6位 | 密码长度 < 6 |
用户名密码不可相同 | user 和 pass 一样 |
邮箱填写错误 | 邮箱格式不合法 |
用户已存在 | 用户名已被占用 |
邮箱已存在 | 邮箱已被使用 |
已达注册上限 | 同 IP 注册次数达上限 |
通用错误
| 错误消息 | 原因 |
|---|---|
程序未开启 / 接口未开启 | 程序或接口未启用 |
时间戳参数不可为空 | 开启时间戳验证但未传 t |
验证数据已失效,请重试 | 时间戳校验失败(排障指南) |
签名参数不可为空 | 开启签名验证但未传 s |
签名有误 | 签名校验失败 |