NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
[TOC] ## 获取验证码 ~~~[api] post:/acquire *string:phone=15181474781#手机号 <<< success { "code": 0, "data": { "expire": 10,//验证码有效分钟数 "length": 6,//验证码长度 "captcha": "175382"//调试输出验证码 } } <<< error { "code": -1, "msg": "手机号长度错误" } ~~~ ## 登录注册 ~~~[api] post:/login *string:phone=15181474781#手机号 *string:sms_captcha=156234#验证码 <<< success { "code": 0, "data": { "sessionKey": "",//登录相关 "sessionValue": "",//登录相关 "type": "user",//用户类型 "account": "手机用户",//账号类型 "id": 1 } } <<< error { "code": -1, "msg": "手机号长度错误" } ~~~ ## 手机号密码注册 ~~~[api] post:/register *string:phone=15181474781#手机号 *string:password=123456#密码 *int:sms_captcha=123456#短信验证码 <<< success { "code": 0 } <<< error { "code": -1, "msg": "该手机号已被使用" } ~~~ ## 手机号密码登录 ~~~[api] post:/loginPwd *string:phone=15181474781#手机号 *string:password=123456#密码 <<< success { "code": 0, "data": { "sessionKey": "PHPSESSID", "sessionValue": "4qvfhcoeoij5ie024smfk6hbrl", "type": "user", "account": "手机用户", "id": 12 } } <<< error { "code": -1, "msg": "手机号11位" } ~~~ ## 找回密码 >[info] 密码请加密 ~~~[api] post:/resetPassword *string:phone=15181474781#手机号 *string:password=123456#密码 *string:sms_captcha=123456#短信验证码 <<< success { "code": 0 } <<< error { "code": -1, "msg": "手机号11位" } ~~~ ## 修改密码 >[info] 密码请加密 ~~~[api] post:/user/changePassword *string:password=123456#原密码 *string:password_new=123456#新密码 <<< success { "code": 0 } <<< error { "code": -1, "msg": "原密码不正确" } ~~~ ## 微信登录 >[info] 微信登录就不触发绑定手机检查了 到指定接口才调用绑定手机接口 ~~~[api] post:/wechatLogin *string:accessToken=fgdedsee#acessTopen *string:openId=4561#openId <<< success { "code": 0, "data": { "sessionKey": "",//登录相关 "sessionValue": "",//登录相关 "type": "user",//用户类型 "account": "微信用户",//账号类型 "id": 1 } } <<< error { "code": -2, "msg": "请先绑定手机" } ~~~ ## 退出登录 ~~~[api] get:/out <<< success { "code": 0 } ~~~