发送短信验证码

为了节约短信数量, 目前不发送短信,注册和忘记密码不校验

  • 地址 :/api/v4.0/sendsms/<string:mobile>
  • 方法 优先POST GET

  • 参数

    • mobile : 手机号 (移动端需要校验正则 1开头的11位数 ^1\\d{10}$'
    • expect : 默认值:0 是期望没注册(用于注册),1 是期望注册过(用于忘记密码)
  • 返回值

    • code 200 成功 -1 注册过/没注册过 其余错误信息提示msg信息
    • msg

例子

http://172.26.106.36:5000/api/v4.0/sendsms/13126939916?expect=1

返回

{
  "code": "200", 
  "msg": "\u53d1\u9001\u6210\u529f"
}

检查手机号是否被注册

注册或忘记密码时,当用户输入完账号时,用于给用户提示。

  • 地址 :/api/v4.0/isregister/<string:phone>
  • 方法 GET
  • 参数
    • phone : 手机号 (移动端需要校验正则 1开头的11位数 ^1\\d{10}$'
    • expect: 期望返回结果 1是期望注册过(用于忘记密码), 0(默认值)是期望没注册(用于注册)
  • 返回值
    • code 200 没注册/注册过 其余错误信息提示msg信息
      • -1 手机号注册过/没注册过
    • msg
http://172.26.106.36:5000/api/v4.0/isregister/13126939916?expect=0

返回JSON

{
  "code": -1, 
  "data": "", 
  "msg": "\u624b\u673a\u53f7\u5df2\u7ecf\u88ab\u6ce8\u518c"
}

注册

  • 地址 :/api/v4.0/register
  • 方法 POST优先 ,GET
  • 参数

    • phone : 手机号 (移动端需要校验正则 1开头的11位数 ^1\\d{10}$'
    • name 姓名
    • password 密码 前端不加密 6-14位
    • device_identifier 设备唯一标示
    • code 验证码 服务器暂时不校验
  • 返回值

    • code 200 成功 其余错误信息提示msg信息
      • -1 手机号注册过
      • -2 验证码错误
    • msg 产生错误的时候,提示的错误信息
    • data
      • change_device 是否更换设备
      • enterprise_id 企业id -1或者Null 表示没有企业
      • token 令牌
      • name 用户姓名
      • pemissions 用户权限
      • user_id 用户id
      • apply:{} 申请状态,注册结束时空对象

例子

http://172.26.106.36:5000/api/v4.0/register?code=xxx&phone=13126939916&name=%E4%BA%8E%E8%BF%9E%E6%9E%97&password=123456&device_identifier=uuid

返回格式

{
  "code": 200, 
  "data": {
    "change_device": false, 
    "enterprise_id": -1, 
    "token": "9ea13c9003d53e4e17b0b9aaf1e634b0", 
    "user_id": "f223fa5c92e846349031b0eb06868478"
    "name":"asdasd"
    "apply":{}
  }, 
  "msg": "\u6ce8\u518c\u6210\u529f"
}

登录

  • 地址 :/api/v4.0/login
  • 方法 POST优先 ,GET
  • 参数

    • phone : 手机号 (移动端需要校验正则 1开头的11位数 ^1\\d{10}$'
    • password 密码 前端不加密
    • device_identifier 设备唯一标示
  • 返回值

    • code 200 成功
      • -1 手机号或密码错误
    • msg 产生错误的时候,提示的错误信息
    • data
      • change_device 是否更换设备
      • enterprise_id 企业id -1或者Null 表示没有企业
      • token 令牌
      • user_id 用户id
      • name 用户姓名
      • pemissions 用户权限
      • apply
        • apply_eid 申请企业的id
        • apply_name 申请企业的名字
        • apply_state 申请状态 -1 拒绝 0 是申请中 1 是通过 例子
http://172.26.106.36:5000/api/v4.0/login?phone=13126939916&password=111111&device_identifier=uuid

返回格式

{
  "code": 200, 
  "data": {
    "apply": {
      "apply_eid": 1, 
      "apply_name": "apple", 
      "apply_state": "0"
    }, 
    "change_device": false, 
    "enterprise_id": "-1", 
    "token": "5a2dd48054d694b0fcaeef1ecca767a2", 
    "user_id": "f223fa5c92e846349031b0eb06868478"
    "name":"asdasd"
  }, 
  "msg": "\u767b\u5f55\u6210\u529f"
}

验证验证码(忘记密码第一步)

  • 地址 :/api/v4.0/verify_code
  • 方法 GET
  • 参数

    • phone : 手机号 (移动端需要校验正则 1开头的11位数 ^1\\d{10}$'
    • code
  • 返回值

    • code 200 成功
      • -1 不正确
    • msg 产生错误的时候,提示的错误信息

例子

http://172.26.106.36:5000/api/v4.0/verify_code?phone=13126939916

返回格式

{
  "code": 200, 
  "data": "", 
  "msg": "\u9a8c\u8bc1\u7801\u6b63\u786e"
}

忘记密码第二步

  • 地址 :/api/v4.0/forget_password
  • 方法 GET POST
  • 参数

    • phone : 手机号 (移动端需要校验正则 1开头的11位数 ^1\\d{10}$'
    • password 6-14位
  • 返回值

    • code 200 成功
      • -1 不正确
    • msg 产生错误的时候,提示的错误信息

例子

http://172.26.106.36:5000/api/v4.0/forget_password?phone=13126939916&password=123456

返回格式

{
  "code": 200, 
  "data": "", 
  "msg": "\u4fee\u6539\u6210\u529f"
}

results matching ""

    No results matching ""