public ServerResponse checkAnswer(String username,String question,String answer){
// ServerResponse checkResp = checkValid(username,Const.USERNMAE);
// if(checkResp.isSuccess()){
// //username不存在
// return ServerResponse.createByErrorMessage(“用户不存在”);
// }
int resultCount = userMapper.checkAnswer(username,question,answer);
if(resultCount == 0){
return ServerResponse.createByErrorMessage(“问题答案错误”);
}
String forgetToken = UUID.randomUUID().toString();
//token存放在本地缓存中
TokenCache.setKey(“token_”+username,forgetToken);
return ServerResponse.createBySuccess(forgetToken);
}