问卷重开
parent
049975b931
commit
5545dec693
|
@ -37,8 +37,10 @@ public class QuestionLogic {
|
|||
public void onLogin(User user) throws Exception{
|
||||
GlobalSystemControl globalSystemControl = GlobalSystemControl.getGlobalSystemControl();
|
||||
if (user.getQuestionManager().getQuestId() != globalSystemControl.getQuestId()) {
|
||||
user.getQuestionManager().setQuestId(globalSystemControl.getQuestId());
|
||||
user.getQuestionManager().setQuestState(0);
|
||||
if(!user.getQuestionManager().getAnswerMap().containsKey(String.valueOf(globalSystemControl.getQuestId()))){
|
||||
user.getQuestionManager().setQuestId(globalSystemControl.getQuestId());
|
||||
user.getQuestionManager().setQuestState(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,7 +56,7 @@ public class QuestionLogic {
|
|||
TreeSet<CQuestionBean> last = new TreeSet<>((CQuestionBean o1, CQuestionBean o2) -> {
|
||||
if (Long.valueOf(o1.getStart()) > Long.valueOf(o2.getStart())) {
|
||||
return -1;
|
||||
} else if (Long.valueOf(o1.getStart()) == Long.valueOf(o2.getStart())) {
|
||||
} else if (Long.valueOf(o1.getStart()) .equals( Long.valueOf(o2.getStart()))) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
|
|
|
@ -274,8 +274,20 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
int uid = packetNetData.getUserId();
|
||||
int token = packetNetData.getToken();
|
||||
session.setUid(uid);
|
||||
session.setToken(token);
|
||||
session.setUserLoginTime(System.currentTimeMillis()/1000);
|
||||
String tokenKey = RedisKey.getKey(RedisKey.TOKEN, String.valueOf(uid),false);
|
||||
if(null==tokenKey||tokenKey.isEmpty()){
|
||||
return false;
|
||||
}
|
||||
String tokenK = (String)RedisUtil.getInstence().get(tokenKey);
|
||||
if(null==tokenK||tokenK.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