| | |
| | | package com.whyc.realm; |
| | | |
| | | import com.whyc.anotation.Realm; |
| | | import com.whyc.pojo.User; |
| | | import com.whyc.pojo.db_user.User; |
| | | import com.whyc.service.UserBridgeService; |
| | | import com.whyc.util.MessageUtils; |
| | | import com.whyc.util.RSAUtil; |
| | |
| | | String name = (String) authenticationToken.getPrincipal(); |
| | | User user = userBridgeService.findPasswordByUserName(name); |
| | | if(user.getId()==0){ |
| | | throw new UnknownAccountException(MessageUtils.getMessage("AccountOrPasswordError")); |
| | | throw new UnknownAccountException("账号或密码错误"); |
| | | } |
| | | String pwd = RSAUtil.decrypt(user.getPwd(),RSAUtil.getPrivateKey()); |
| | | return new SimpleAuthenticationInfo(user,pwd,getName()); |