generated from root/miduo_server
redis
parent
4a73846f90
commit
cd31e6fa09
|
|
@ -52,7 +52,6 @@ public class UserLoginController extends HttpServlet {
|
|||
DBObject one = BaseGlobal.getInstance().mongoDBPool.findOne(_COLLECTION_NAME, name);
|
||||
if(one ==null){
|
||||
resMsg.setMsg("该账号不存在");
|
||||
resMsg.setMsg(returnMsg);
|
||||
out.print(gson.toJson(resMsg));
|
||||
return;
|
||||
}
|
||||
|
|
@ -63,10 +62,11 @@ public class UserLoginController extends HttpServlet {
|
|||
return;
|
||||
}
|
||||
Map<String,String> parms = new HashMap<>();
|
||||
String openId = one.get("openId").toString();
|
||||
parms.put("openId",one.get("openId").toString());
|
||||
int token = new Random().nextInt(1024) +10000;
|
||||
parms.put("token",Integer.toString(token));
|
||||
BaseGlobal.getInstance().redisApp.set(RedisKey.LOGIN_TOKEN,name,token,-1, false);
|
||||
BaseGlobal.getInstance().redisApp.set(RedisKey.LOGIN_TOKEN,openId,token,-1, false);
|
||||
resMsg.setCode(0);
|
||||
resMsg.setMsg(returnMsg);
|
||||
resMsg.setParms(parms);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class RedisApp {
|
|||
}
|
||||
|
||||
public <K, T> T get(final String type, final K key, final Class<T> clazz, final int seconds) throws Exception {
|
||||
return get(type, key, clazz, seconds, true);
|
||||
return get(type, key, clazz, seconds, false);
|
||||
}
|
||||
|
||||
//取得键值
|
||||
|
|
|
|||
Loading…
Reference in New Issue