Skip to content

API参考

认证接口

登录接口

接口地址/api/sysAuth/Login

请求方法:POST

请求参数

参数名类型必需描述
accountstring账号
passwordstring加密后的密码
codestring验证码
codeIdnumber验证码ID

响应格式

json
{
  "type": "success",
  "result": {
    "accessToken": "...",
    "refreshToken": "..."
  }
}

获取验证码

接口地址/api/sysAuth/captcha

请求方法:GET

响应格式

json
{
  "type": "success",
  "result": {
    "id": 123,
    "img": "base64编码的图片"
  }
}

获取用户信息

接口地址/api/sysAuth/userInfo

请求方法:GET

请求头

  • Authorization: Bearer

响应格式

json
{
  "type": "success",
  "result": {
    "userName": "...",
    "roles": ["user", "vip"]
  }
}

其他接口

接口规范

  • 所有接口返回格式统一
  • 成功响应:{"type": "success", "result": {...}}
  • 失败响应:{"type": "error", "message": "错误信息"}

错误码

错误码描述
401未授权
403无权限
404资源不存在
500服务器内部错误