generated from root/miduo_server
fix account
parent
7d389693b9
commit
55ee91970e
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ljsd.redis;
|
|||
|
||||
public interface RedisKey {
|
||||
String TOKEN = "JL_TOKEN";
|
||||
String PIDGIDTEMP = "PIDGIDTEMP";
|
||||
String LOGIN_TOKEN = "JL_LOGIN_TOKEN";
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue