- 01.认证中心
- 02.用户接口
- 03.角色接口
- 04.菜单接口
- 05.部门接口
- 06.字典接口
- 07.文件接口
- 08.系统配置
- 09.通知公告
- 10.日志接口
- 11.代码生成
修改用户
PUT
https://api.youlai.tech/api/v1/users/{userId}
02.用户接口
请求参数
Path 参数
userId
integer
用户ID
Header 参数
Authorization
string
可选
默认值:
{{tokenType}} {{accessToken}}
Body 参数application/json
用户表单对象
id
integer <int64>
用户ID
username
string
用户名
nickname
string
昵称
mobile
string
手机号码
正则匹配:
^$|^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$
gender
integer <int32>
性别
avatar
string
用户头像
email
string
邮箱
status
integer <int32>
可选
deptId
integer <int64>
部门ID
roleIds
array[integer <int64>]
角色ID集合
openId
string
微信openId
示例
{
"id": 0,
"username": "string",
"nickname": "string",
"mobile": "string",
"gender": 0,
"avatar": "string",
"email": "string",
"status": 0,
"deptId": 0,
"roleIds": [
0
],
"openId": "string"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.youlai.tech/api/v1/users/' \
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 0,
"username": "string",
"nickname": "string",
"mobile": "string",
"gender": 0,
"avatar": "string",
"email": "string",
"status": 0,
"deptId": 0,
"roleIds": [
0
],
"openId": "string"
}'
返回响应
🟢200OK
application/json
Body
code
string
可选
data
object
可选
msg
string
可选
示例
{
"code": "string",
"data": {},
"msg": "string"
}
🟠400Bad Request
🟠403Forbidden
🟠404Not Found