获取访问令牌

请求方式: POST

请求地址: {base_url}/oauth/issue-token

请求参数

参数类型是否必填最大长度描述示例值
usernamestring32账号/身份证号码webman
passwordstring32密码webman123.

请求数据结构

{
    "username": "webman",
    "password": "webman123."
}
1
2
3
4

响应参数

参数类型是否必填最大长度描述示例值
tokenarray16令牌信息--
└ token_typestring8Token 类型Bearer
└ expires_inint16凭证有效时间,单位:秒7200
└ access_tokenint64访问凭证XXXXXXXXXXXXXXXXXXXXXXXXXX
user_infoarray16用户信息--
└ usernamestring8用户名称阿克苏
└ mobilestring8手机号码13669361192
└ emailstring16邮箱Tinywan@163.com
└ avatarstring16头像https://live-oss.busionline.com/assets/images/avatars/6avatar.jpg
└ is_enabledint1是否被禁用1
└ is_adminbool4true 是,falsetrue

响应示例

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8

{
    "code": 0,
    "msg": "success",
    "data": {
        "token": {
            "token_type": "Bearer",
            "expires_in": 36000,
            "access_token": "xxxxxxxxxxxxxxxxxxx",
            "refresh_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        },
        "user_info": {
            "id": 200001,
            "username": "阿克苏",
            "mobile": "13669361192",
            "email": "Tinywan@163.com",
            "avatar": "https://www.webman-admin.com/assets/images/avatars/6avatar.jpg",
            "is_enabled": 1,
            "create_time": "2021-11-12 10:48:59",
            "is_admin": true
        },
        "menus": []
    },
    "request_id": "ea920f84-42bd-491b-bc1a-7105bb768148"
}
 
 

























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

异常示例

HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=UTF-8

{
    "code": 0,
    "msg": "用户名不存在",
    "data": {}
}
 
 






1
2
3
4
5
6
7
8
最近修改时间:
贡献者: Tinywan