|  | 
 
 楼主|
发表于 2020-9-6 21:58:15
|
显示全部楼层 
| --登陆注册
 if s and s.id then
 local id = tostring(s.id)
 local ptid = nil
 local err = ""
 
 if s.guest and tonumber(s.guest) == 1 then
 --游客登录
 
 --查找游客表是否存在ptid
 ptid, err = db.get_acc_guest(id)
 
 else
 --正式登录
 if s.psw then
 --查找正式账号表是否存在ptid
 ptid, err = db.check_acc_normal(s.id, tostring(s.psw))
 
 else
 return errcode.ERR_NONE_PSW
 end
 end
 
 --通过验证则生成ticket,并返回给客户端
 if ptid then
 --缓存ticket等待verify验证
 --cache.del_to_cache(ptid)
 
 --local ok = cache.add_to_cache(new_ticket, ptid, 60)  --s 超时
 local new_ticket = ngx.md5(ptid .. '/' .. tostring(ngx.time())..'/'..ngx.var.pid)
 local ok, rerr = db.save_ticket(new_ticket, ptid)
 if not ok then
 return rerr
 end
 
 怎么改呀
  
 | 
 |