| | |
| | | Authentication authentication = null; |
| | | try { |
| | | //登录密码解密 |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, RsaUtils.decryptByPrivateKey(password)); |
| | | //UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, password); |
| | | String s = RsaUtils.decryptByPrivateKey(password); |
| | | if(username.equals("10001")){ |
| | | s=username+s; |
| | | } |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username,s); |
| | | AuthenticationContextHolder.setContext(authenticationToken); |
| | | // 该方法会去调用UserDetailsServiceImpl.loadUserByUsername |
| | | authentication = authenticationManager.authenticate(authenticationToken); |
| | |
| | | loginUser.setHospName(dictHosp.getHospAreaName()); |
| | | if(!SecurityUtils.isAdmin(user.getUserId())){ |
| | | if(dictHosp.getSecretKey() != null && dictHosp.getExpirationTime() != null){ |
| | | if (!SecurityUtils.matchesMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getAreaid(), |
| | | if (!SecurityUtils.matchesMallMerchantSecretKey(secret,dictHosp.getHospAreaId(),dictHosp.getHospAreaName(), |
| | | dictHosp.getExpirationTime(),dictHosp.getSecretKey())) { |
| | | throw new SecretKeyException("商家已过期请续费使用"); |
| | | } |