|
|
@@ -28,10 +28,7 @@ import java.util.*;
|
|
|
@RequiredArgsConstructor
|
|
|
public class LoginService {
|
|
|
private final LoginDao dao;
|
|
|
- private final TokenService tokenService;
|
|
|
- private final CorpWxSrvc srvc;
|
|
|
private final UserCache userCache;
|
|
|
- private final DeptCache deptCache;
|
|
|
private final PublicServer publicServer;
|
|
|
private final SendWxInfoService sendWxInfoService;
|
|
|
|
|
|
@@ -42,7 +39,7 @@ public class LoginService {
|
|
|
private String newPwd;
|
|
|
}
|
|
|
|
|
|
- public ResultVo<UserInfo> login(UserInfo userInfo, HttpServletRequest request, boolean encrypt) {
|
|
|
+ public ResultVo<UserInfo> login(UserInfo userInfo, boolean encrypt) {
|
|
|
UserInfo tempUserInfo = dao.findUserByCodeRsFromDjUserBase(userInfo.getCodeRs());
|
|
|
if (null == tempUserInfo) {
|
|
|
tempUserInfo = dao.findUserByCodeRsFromEmployeeMi(userInfo.getCodeRs());
|
|
|
@@ -58,7 +55,7 @@ public class LoginService {
|
|
|
if (through) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.INVALID_PASSWORD, userInfo);
|
|
|
}
|
|
|
- String token = TokenUtil.getInstance().createToken(tempUserInfo.getCode());
|
|
|
+ String token = TokenUtil.getInstance().createToken(tempUserInfo.getCode(), pwd);
|
|
|
tempUserInfo = userCache.get(tempUserInfo.getCode());
|
|
|
tempUserInfo.setToken(token);
|
|
|
return ResultVoUtil.success(tempUserInfo);
|
|
|
@@ -92,12 +89,12 @@ public class LoginService {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "验证码过期或者验证码错误。");
|
|
|
}
|
|
|
|
|
|
- public ResultVo<UserInfo> simpleLogin(String code, HttpServletRequest request) {
|
|
|
+ public ResultVo<UserInfo> simpleLogin(String code) {
|
|
|
UserInfo us = dao.getUserInfoByCode(code);
|
|
|
if (us == null) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.NOT_EL_MESSAGE, "用户不存在");
|
|
|
}
|
|
|
- return login(us, request, false);
|
|
|
+ return login(us, false);
|
|
|
}
|
|
|
|
|
|
public ResultVo<List<CodeName>> getWards() {
|