当前查看模块:auth
| 参数名 | 必填 | 类型 | 示例 | 说明 |
|---|---|---|---|---|
| Authorization | 否 | string | Bearer <JWT token> |
用户登录后的 JWT 令牌。若已登录可直接使用,无需传 X-Client。。认证 Token,请在请求头中携带,推荐格式:Bearer {token} |
| X-Client | 否 | string | <client key token> |
客户端密钥。当未携带或无法使用 Authorization 时必填,用于密钥认证。线上文档: http://localhost:5601/docs |
| X-Site | 是 | string | <site key> |
站点标识(必填)。用于切换站点和对应的数据库上下文。所有 OpenAPI 接口必须提供有效的 X-Site header。 |
| X-System-Code | 是 | string | AUTH_MANAGEMENT |
系统编码(必填)。用于指定当前访问的业务系统(例如 AUTH_MANAGEMENT、CONTENT_MANAGEMENT)。当系统不支持时将返回“登录用户不支持当前系统,可联系管理员处理”。 |
模块标识: auth | 接口数量: 4
/auth/register
{
"name": "string|必填,用户名",
"phone": "string|必填,手机号",
"password": "string|必填,登录密码",
"email": "string|可选,邮箱",
"individualism": "boolean|可选,是否创建独立站点,默认 false"
}请按照示例结构封装请求体字段,并确保必填字段完整。
{
"success": {
"code": "0000",
"message": "注册成功",
"data": {
"token": "jwt-token",
"user": {
"id": "USER0001",
"code": "USER000001",
"name": "张三",
"phone": "13800138000",
"email": "zhangsan@example.com",
"individualism": true,
"individualDbName": "user_1_1764407777204"
},
"clientKey": {
"id": "key-id",
"keyToken": "key-token",
"individualDbName": "user_1_1764407777204"
}
}
},
"failure": {
"code": "4000",
"message": "注册失败",
"data": null
}
}
/auth/login
| 参数名 | 必填 | 类型 | 示例 | 说明 |
|---|---|---|---|---|
| system | 否 | string | - | 系统编码,登录时自动分配系统默认管理员角色 |
{
"phone": "string|必填,手机号",
"password": "string|必填,登录密码"
}请按照示例结构封装请求体字段,并确保必填字段完整。
{
"success": {
"code": "0000",
"message": "登录成功",
"data": {
"token": "jwt-token",
"user": {
"id": "USER0001",
"code": "USER000001",
"username": "系统管理员",
"phone": "13800138000",
"email": "admin@example.com",
"individualism": true,
"individualDbName": "user_1_1764407777204",
"status": 1,
"createTime": "2025-01-21T10:00:00.000Z",
"accountType": "user",
"type": "普通用户"
},
"availableSites": [
{
"siteKey": "56B57A72-59C4-460B-82E5-22196205391B-A4608B6E9D4D6F599",
"name": "所属站点",
"type": "owner",
"isDefault": true
},
{
"siteKey": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890-ABCDEF12",
"name": "个人站点",
"type": "personal",
"isDefault": false
}
]
}
},
"failure": {
"code": "4000",
"message": "登录失败",
"data": null
}
}
/auth/client/register
{
"name": "string|可选,客户端用户姓名,默认为'游客'",
"phone": "string|必填,手机号",
"password": "string|必填,登录密码",
"email": "string|可选,邮箱",
"agreeTerms": "boolean|必填,是否同意协议",
"individualism": "boolean|可选,是否创建独立站点,默认 false"
}请按照示例结构封装请求体字段,并确保必填字段完整。
{
"success": {
"code": "0000",
"message": "注册成功",
"data": {
"token": "jwt-token",
"user": {
"id": "CU0001",
"code": "CU000001",
"username": "客户端用户",
"phone": "13800138000",
"email": "user@example.com",
"individualism": true,
"individualDbName": "client_user_1_1764407777204"
},
"clientKey": {
"id": "key-id",
"keyToken": "key-token",
"individualDbName": "client_user_1_1764407777204"
}
}
},
"failure": {
"code": "4000",
"message": "注册失败",
"data": null
}
}
/auth/client/login
| 参数名 | 必填 | 类型 | 示例 | 说明 |
|---|---|---|---|---|
| system | 否 | string | - | 系统编码,登录时自动分配系统默认管理员角色 |
{
"phone": "string|必填,手机号",
"password": "string|必填,登录密码",
"agreeTerms": "boolean|必填,是否同意协议"
}请按照示例结构封装请求体字段,并确保必填字段完整。
{
"success": {
"code": "0000",
"message": "登录成功",
"data": {
"token": "jwt-token",
"user": {
"id": "CU0001",
"code": "CU000001",
"username": "客户端管理员",
"phone": "13800138000",
"email": "client@example.com",
"individualism": true,
"individualDbName": "client_user_1_1764407777204",
"status": 1,
"createTime": "2025-01-21T10:00:00.000Z",
"accountType": "clientUser",
"type": "散客"
},
"availableSites": [
{
"siteKey": "56B57A72-59C4-460B-82E5-22196205391B-A4608B6E9D4D6F599",
"name": "所属站点",
"type": "owner",
"isDefault": true
},
{
"siteKey": "A1B2C3D4-E5F6-7890-ABCD-EF1234567890-ABCDEF12",
"name": "个人站点",
"type": "personal",
"isDefault": false
}
]
}
},
"failure": {
"code": "4000",
"message": "登录失败",
"data": null
}
}