Skip to content

鉴权(登录/登出/改密) ( auth ) 相关文档

登录 ✅

请求地址:POST /auth/login

参数:

参数名位置类型格式化必填说明
namebodystring(无)
passwordbodystring(无)

使用示例:

javascript
// 登录成功 - /auth/login 
input = {
  "name": "admin",
  "password": "123456"
};
output = {
  "success": true,
  "data": {
    "admin": {
      "id": 1,
      "name": "admin",
      "nickname": "admin",
      "mustChangePassword": true
    },
    "mustChangePassword": true
  }
};

当前管理员 ✅

请求地址:GET /auth/me

参数:无参数

使用示例:

javascript
// 当前管理员 - /auth/me 
input = {};
output = {
  "success": true,
  "data": {
    "id": 1,
    "name": "admin",
    "nickname": "admin",
    "mustChangePassword": true
  }
};

修改密码 ✅

请求地址:PUT /auth/password

参数:

参数名位置类型格式化必填说明
oldPasswordbodystring(无)
newPasswordbodystring(无)

使用示例:

javascript
// 修改密码 - /auth/password 
input = {
  "oldPassword": "123456",
  "newPassword": "newpass123"
};
output = {
  "success": true,
  "data": {
    "success": true
  }
};

登出 ✅

请求地址:POST /auth/logout

参数:无参数

使用示例:

javascript
// 登出 - /auth/logout 
input = {};
output = {
  "success": true,
  "data": {
    "success": true
  }
};

基于 MIT 协议发布