开放平台

扒书 ERP Open API

账号密码登录

用用户名、密码(可选带图形验证码)换取登录 Token,之后的请求都要在请求头里带上它。

请求方式GET/POST
接口路径/api/auth/login
Content-Type-
鉴权免登录(无需 Token)

请求参数

参数类型必填位置
usernameString否URL 参数
passwordString否URL 参数
captchaString否URL 参数

curl 调用

curl -s 'https://www.8shu8.com/api/auth/login?username=xxx&password=xxx&captcha=xxx'

响应示例

{
  "code": 200,
  "message": "操作成功",
  "success": true,
  "data": {
    "token": "string",
    "userInfo": {
      "id": 1,
      "username": "string",
      "password": "string",
      "gender": 1,
      "birthday": "string",
      "registerTime": "string",
      "lastLoginTime": "string",
      "lastLoginIp": "string",
      "userLevelId": "...",
      "nickname": "string",
      "mobile": "string",
      "registerIp": "string",
      "avatar": "string",
      "school": "string",
      "lat": 0.0,
      "lon": 0.0,
      "major": "string",
      "unionId": "string",
      "degree": 1,
      "realName": "string",
      "schoolId": 1,
      "manageSchoolId": 1,
      "majorId": 1,
      "invitedUserId": 1,
      "rewardPoints": 1,
      "bookVoucher": "...",
      "sign": "string",
      "openid": "string",
      "subOpenid": "string",
      "userType": "...",
      "tenantId": "string",
      "bannedAccount": true,
      "city": "string",
      "alipayAccount": "string",
      "term": 1,
      "lastMsg": "string",
      "approvalTime": "string",
      "email": "string",
      "qq": 1,
      "wechat": "string",
      "modifier": 1,
      "applyTime": "string",
      "lastSendMsgTime": 1,
      "adminUserId": 1,
      "applyRole": 1,
      "uniName": "string",
      "token": "string"
    },
    "userId": 1,
    "expire": 1,
    "menuTrees": [
      {
        "id": "...",
        "parentId": "...",
        "name": "...",
        "href": "...",
        "icon": "...",
        "child": "..."
      }
    ]
  }
}

返回字段(data)

字段类型说明
tokenString-
userInfo对象-
userInfo.idLong-
userInfo.usernameString-
userInfo.passwordString-
userInfo.genderInteger-
userInfo.birthdayLocalDateTime-
userInfo.registerTimeLocalDateTime-
userInfo.lastLoginTimeLocalDateTime-
userInfo.lastLoginIpString-
userInfo.userLevelId对象-
userInfo.nicknameString-
userInfo.mobileString-
userInfo.registerIpString-
userInfo.avatarString-
userInfo.schoolString-
userInfo.latDouble-
userInfo.lonDouble-
userInfo.majorString-
userInfo.unionIdString-
userInfo.degreeInteger-
userInfo.realNameString-
userInfo.schoolIdInteger-
userInfo.manageSchoolIdInteger-
userInfo.majorIdInteger-
userInfo.invitedUserIdLong-
userInfo.rewardPointsInteger-
userInfo.bookVoucher对象-
userInfo.signString-
userInfo.openidString-
userInfo.subOpenidString-
userInfo.userType对象-
userInfo.tenantIdString租户ID,默认 bs;多 appid 共用用户表时按租户隔离
userInfo.bannedAccountBoolean-
userInfo.cityString-
userInfo.alipayAccountString-
userInfo.termInteger学期
userInfo.lastMsgString-
userInfo.approvalTimeLocalDateTime-
userInfo.emailString-
userInfo.qqLong-
userInfo.wechatString-
userInfo.modifierLong-
userInfo.applyTimeLocalDateTime-
userInfo.lastSendMsgTimeLong最后一次发送验证信息毫秒数
userInfo.adminUserIdLong-
userInfo.applyRoleInteger管理的学校
userInfo.uniNameString-
userInfo.tokenString登录 token,非表字段,仅个人中心等接口回填
userIdLong-
expireLong-
menuTrees对象数组-
menuTrees[].idInteger-
menuTrees[].parentIdInteger父级菜单id
menuTrees[].nameString名字
menuTrees[].hrefString路径
menuTrees[].iconString图标
menuTrees[].child对象数组-
menuTrees[].child[].idInteger-
menuTrees[].child[].parentIdInteger父级菜单id
menuTrees[].child[].nameString名字
menuTrees[].child[].hrefString路径
menuTrees[].child[].iconString图标
menuTrees[].child[].child对象数组-
…(字段较多,仅列前 60 个)