取绝对值

master
jiahuiwen 2019-01-04 18:41:54 +08:00
parent 1be23f4b78
commit 54332bdac7
1 changed files with 2 additions and 2 deletions

View File

@ -53,10 +53,10 @@ public class GetUserController extends HttpServlet {
BaseGlobal.getInstance().mongoDBPool.save(_COLLECTION_NAME, dbObject);
}
Random random = new Random();
int token = random.nextInt(Integer.MAX_VALUE);
int token = random.nextInt();
uid = (int) userInfos.get(0).get("uid");
res.put("uid", uid);
res.put("token", token);
res.put("token", Math.abs(token));
BaseGlobal.getInstance().redisApp.set(RedisKey.TOKEN, String.valueOf(uid), token, -1, false);
PrintWriter out = response.getWriter();
out.print(res);