token验证
parent
91c017cbd5
commit
f5fb83d1b4
|
@ -277,12 +277,16 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
int uid = packetNetData.getUserId();
|
||||
int token = packetNetData.getToken();
|
||||
session.setUid(uid);
|
||||
/* String tokenKey = RedisKey.getKey(RedisKey.TOKEN, String.valueOf(uid),false);
|
||||
int serverToken = Integer.parseInt((String)RedisUtil.getInstence().get(tokenKey));
|
||||
if (token == serverToken){
|
||||
session.setToken(token);
|
||||
return true;
|
||||
}*/
|
||||
// String tokenKey = RedisKey.getKey(RedisKey.TOKEN, String.valueOf(uid),false);
|
||||
// if(null==tokenKey||tokenKey.isEmpty()){
|
||||
// return false;
|
||||
// }
|
||||
// int serverToken = Integer.parseInt((String)RedisUtil.getInstence().get(tokenKey));
|
||||
// if (token == serverToken){
|
||||
// session.setToken(token);
|
||||
// session.setUserLoginTime(System.currentTimeMillis()/1000);
|
||||
// return true;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue