问卷重开
parent
049975b931
commit
5545dec693
|
@ -37,9 +37,11 @@ public class QuestionLogic {
|
||||||
public void onLogin(User user) throws Exception{
|
public void onLogin(User user) throws Exception{
|
||||||
GlobalSystemControl globalSystemControl = GlobalSystemControl.getGlobalSystemControl();
|
GlobalSystemControl globalSystemControl = GlobalSystemControl.getGlobalSystemControl();
|
||||||
if (user.getQuestionManager().getQuestId() != globalSystemControl.getQuestId()) {
|
if (user.getQuestionManager().getQuestId() != globalSystemControl.getQuestId()) {
|
||||||
|
if(!user.getQuestionManager().getAnswerMap().containsKey(String.valueOf(globalSystemControl.getQuestId()))){
|
||||||
user.getQuestionManager().setQuestId(globalSystemControl.getQuestId());
|
user.getQuestionManager().setQuestId(globalSystemControl.getQuestId());
|
||||||
user.getQuestionManager().setQuestState(0);
|
user.getQuestionManager().setQuestState(0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +56,7 @@ public class QuestionLogic {
|
||||||
TreeSet<CQuestionBean> last = new TreeSet<>((CQuestionBean o1, CQuestionBean o2) -> {
|
TreeSet<CQuestionBean> last = new TreeSet<>((CQuestionBean o1, CQuestionBean o2) -> {
|
||||||
if (Long.valueOf(o1.getStart()) > Long.valueOf(o2.getStart())) {
|
if (Long.valueOf(o1.getStart()) > Long.valueOf(o2.getStart())) {
|
||||||
return -1;
|
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;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -274,10 +274,22 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
||||||
int uid = packetNetData.getUserId();
|
int uid = packetNetData.getUserId();
|
||||||
int token = packetNetData.getToken();
|
int token = packetNetData.getToken();
|
||||||
session.setUid(uid);
|
session.setUid(uid);
|
||||||
|
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.setToken(token);
|
||||||
session.setUserLoginTime(System.currentTimeMillis()/1000);
|
session.setUserLoginTime(System.currentTimeMillis()/1000);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private int dealRepeatLogin(int uid) {
|
private int dealRepeatLogin(int uid) {
|
||||||
|
|
Loading…
Reference in New Issue