获取当前用户
开发中
GET
/currentUser
请求参数
Header 参数
Authorization
string
可选
示例值:
{{token}}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'http://localhost:8081/currentUser' \
--header 'Authorization: '
返回响应
🟢200成功
application/json
Body
code
integer
必需
success
boolean
必需
message
string
必需
data
object
必需
token
string
必需
id
integer
必需
name
string
必需
nickName
string
必需
username
string
必需
phone
string
必需
email
string
必需
avatarFileId
null
必需
password
string
必需
gender
integer
必需
authObject
object
必需
loginTime
string
必需
passwordExpiredTime
null
必需
accountLockedDeadline
null
必需
enabled
boolean
必需
createTime
string
必需
updateTime
null
必需
authorities
array [object {1}]
必需
accountNonExpired
boolean
必需
credentialsNonExpired
boolean
必需
accountNonLocked
boolean
必需
示例
{
"code": 200,
"success": true,
"message": "成功",
"data": {
"token": "0852aeb6-a53d-4f3d-bf05-f96e7ab9bcae",
"id": 1,
"name": "系统用户",
"nickName": "系统用户",
"username": "admin",
"phone": "12110",
"email": "593655063@qq.com",
"avatarFileId": null,
"password": "",
"gender": 1,
"authObject": {
"users": [
{
"id": 1,
"name": "1",
"auth": {
"auth": "USER_1",
"description": "USER_1"
}
}
],
"roles": [
{
"id": 1,
"name": "超级管理员",
"auth": {
"auth": "ROLE_1",
"description": "ROLE_超级管理员"
}
}
],
"depts": [
{
"id": 1,
"name": "根部门",
"auth": {
"auth": "DEPT_1",
"description": "DEPT_根部门"
}
}
],
"empty": false
},
"loginTime": "2024-08-27 16:01:32",
"passwordExpiredTime": null,
"accountLockedDeadline": null,
"enabled": true,
"createTime": "2024-08-01 00:00:00",
"updateTime": null,
"authorities": [
{
"authority": "USER_1"
},
{
"authority": "ROLE_1"
},
{
"authority": "DEPT_1"
}
],
"accountNonExpired": true,
"credentialsNonExpired": true,
"accountNonLocked": true
}
}