| | |
| | | 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", "当前没有查询到考试信息"); |
| | | } |
| | | } |
| | | } |
| | | }else { |
| | | //新增登录记录 |
| | | this.saveLoginRecord(userInfo); |
| | | System.out.println("grantType = " + grantType); |
| | | //刷新 token 不新增登录记录 |
| | | if (!grantType.equals("refresh_token")){ |
| | | //新增登录记录 |
| | | this.saveLoginRecord(userInfo); |
| | | } |
| | | } |
| | | return TokenUtil.createAuthInfo(userInfo); |
| | | } |