添加错误码

master
jiahuiwen 2020-11-13 14:32:56 +08:00
parent a833a6a913
commit 5c8a6d7a2a
1 changed files with 8 additions and 1 deletions

View File

@ -70,7 +70,13 @@ public class GetUserController extends HttpServlet {
String[] split = banInfo.split("\\|");
long currentTimeMillis = System.currentTimeMillis();
if (Long.parseLong(split[0]) > currentTimeMillis) {
response.sendError(400, split[1]);
DBObject res = new BasicDBObject();
res.put("errorCode", -1);
res.put("reason", split[1]);
PrintWriter out = response.getWriter();
out.print(res);
out.flush();
out.close();
LOGGER.info("doGet can not login Ban_Open_Id=>{} openId=>{} banInfo==null ? {}", RedisKey.Ban_Open_Id, openId, banInfo==null ? null : banInfo);
return;
} else {
@ -146,6 +152,7 @@ public class GetUserController extends HttpServlet {
uid = (int) userInfos.get(0).get("uid");
res.put("uid", uid);
res.put("token", utoken);
res.put("errorCode", 0);
BaseGlobal.getInstance().redisApp.set(RedisKey.TOKEN, String.valueOf(uid), utoken, -1, false);
BaseGlobal.getInstance().redisApp.set(RedisKey.PIDGIDTEMP, String.valueOf(uid), pid+"#"+gid, -1, false);