Open unissoft-bj opened 9 years ago
register(String netCode) return:userInfo{phone、userRole} userRole: -1-failed,0-普通用户,1-销售经理,2-销售顾问,3-客服 服务端操作:如果注册成功则将该用户相应的登陆信息如mac-pwd加ihost指纹写入到cookie中,将用户id等webstate信息写在session中。 前台操作:登陆失败提示相应的信息; 登陆成功后先开通internet,然后根据userRole转到相应的页面
post: /register pamars:shangwangma return:null 去找httpcode
用户在前端页面输入上网码. 用户是否也需输入phone?
输入上网码时,不需要phone 销售顾问发放上网码时,如果收集到了手机号,则phone已经在database中; 如果没有收集到手机号,则database中没有phone,此时相当于借用销售顾问的account上网。需要注意的是,此时仅接通internet,不会返回销售顾问的account,不能进入到销售顾问的工作界面
with empty phone: { name: "005056C00008" mac: "005056C00008" mac_pwd: "f64fd6d0-49f8-4fc8-a787-59766e7069d4" role: "UNKNOWN" phone: "UNKNOWN" }
rest example: post http://ihost:8080/register
json payload: {"mac":"88-36-99-FF-FF-BB","token":"503336"}
return json message: { name: "88-36-99-FF-FF-BB" mac: "88-36-99-FF-FF-BB" mac_pwd: "68d369de-f603-4ecf-b3b9-1a11420eee2e" role: "ROLE_USER" phone: "5016548878" }
error code http 404: cannot find the token http 409: token has been used http 400: token expires. now the token expires in 24 hours.
use case:
用户在前端页面输入上网码
提交参数:上网码,mac 返回参数:状态,account,mac-pwd
REST 逻辑: 1,接收上网码,mac参数 2,到“码表”中查找对应的上网码记录(上网码,有效期)