取绝对值

master
jiahuiwen 2019-01-04 18:44:38 +08:00
parent 54332bdac7
commit 894791394f
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();
int token = Math.abs(random.nextInt());
uid = (int) userInfos.get(0).get("uid");
res.put("uid", uid);
res.put("token", Math.abs(token));
res.put("token", token);
BaseGlobal.getInstance().redisApp.set(RedisKey.TOKEN, String.valueOf(uid), token, -1, false);
PrintWriter out = response.getWriter();
out.print(res);