|
@@ -35,9 +35,12 @@ public class LoginService {
|
|
|
private final SendWxInfoService sendWxInfoService;
|
|
|
|
|
|
@Autowired
|
|
|
- public LoginService(LoginDao dao, TokenService tokenService,
|
|
|
+ public LoginService(LoginDao dao,
|
|
|
+ TokenService tokenService,
|
|
|
RedisLikeService redisLikeService,
|
|
|
- CorpWxSrvc srvc, PublicServer publicServer, SendWxInfoService sendWxInfoService) {
|
|
|
+ CorpWxSrvc srvc,
|
|
|
+ PublicServer publicServer,
|
|
|
+ SendWxInfoService sendWxInfoService) {
|
|
|
this.dao = dao;
|
|
|
this.tokenService = tokenService;
|
|
|
this.redisLikeService = redisLikeService;
|
|
@@ -46,7 +49,7 @@ public class LoginService {
|
|
|
this.sendWxInfoService = sendWxInfoService;
|
|
|
}
|
|
|
|
|
|
- public ResultVo<UserInfo> login(UserInfo userInfo) {
|
|
|
+ public ResultVo<UserInfo> login(UserInfo userInfo, boolean encrypt) {
|
|
|
Date now = new Date();
|
|
|
UserInfo tempUserInfo = dao.findUserByCodeRsFromDjUserBase(userInfo.getCodeRs());
|
|
|
if (null == tempUserInfo) {
|
|
@@ -57,7 +60,7 @@ public class LoginService {
|
|
|
dao.insertNewUserToDjUserBase(tempUserInfo);
|
|
|
}
|
|
|
|
|
|
- String pwd = SecureUtil.md5(userInfo.getPassword());
|
|
|
+ String pwd = encrypt ? SecureUtil.md5(userInfo.getPassword()) : userInfo.getPassword();
|
|
|
if (!Objects.equals("fromTriageScreen", userInfo.getSid()) && !pwd.equals(tempUserInfo.getPassword())) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INVALID_PASSWORD, userInfo);
|
|
|
}
|
|
@@ -108,7 +111,7 @@ public class LoginService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NOT_EL_MESSAGE, "用户不存在");
|
|
|
}
|
|
|
JSONObject js = new JSONObject();
|
|
|
- ResultVo<UserInfo> userInfoResultVo = login(us);
|
|
|
+ ResultVo<UserInfo> userInfoResultVo = login(us, false);
|
|
|
if (userInfoResultVo.getCode() == 200) {
|
|
|
js.put("userInfo", userInfoResultVo.getData());
|
|
|
} else {
|