fix account

master
wangyuan 2019-11-29 15:05:48 +08:00
parent 7d389693b9
commit 55ee91970e
2 changed files with 9 additions and 6 deletions

View File

@ -90,13 +90,7 @@ public class GetUserController extends HttpServlet {
dbObject.put("openId", openId);
dbObject.put("serverId", serverId);
dbObject.put("platform", platform);
if (gid != null && !gid.isEmpty()) {
dbObject.put("gid", gid);
}
if (pid != null && !pid.isEmpty()) {
dbObject.put("pid", pid);
}
int uid = 0;
@ -107,6 +101,12 @@ public class GetUserController extends HttpServlet {
dbObject.put("uid", uid);
dbObject.put("_id", uid);
userInfos.add(dbObject);
if (gid != null && !gid.isEmpty()) {
dbObject.put("gid", gid);
}
if (pid != null && !pid.isEmpty()) {
dbObject.put("pid", pid);
}
BaseGlobal.getInstance().mongoDBPool.save(_COLLECTION_NAME, dbObject);
}
Random random = new Random();
@ -115,6 +115,8 @@ public class GetUserController extends HttpServlet {
res.put("uid", uid);
res.put("token", utoken);
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);
PrintWriter out = response.getWriter();
out.print(res);
out.flush();

View File

@ -2,6 +2,7 @@ package com.ljsd.redis;
public interface RedisKey {
String TOKEN = "JL_TOKEN";
String PIDGIDTEMP = "PIDGIDTEMP";
String LOGIN_TOKEN = "JL_LOGIN_TOKEN";
/**