|
@@ -30,6 +30,8 @@ public class ZhcxLoginServiceImpl implements ZhcxLoginService {
|
|
|
private RedisService redisService;
|
|
|
@Autowired
|
|
|
private RwAdminServerFeignService rwAdminServerFeignService;
|
|
|
+ @Autowired
|
|
|
+ private SysUserService sysUserService;
|
|
|
|
|
|
@Override
|
|
|
public R loginIn(Map<String, Object> map) {
|
|
@@ -51,14 +53,28 @@ public class ZhcxLoginServiceImpl implements ZhcxLoginService {
|
|
|
UserLoginVo userLoginVo = new UserLoginVo();
|
|
|
userLoginVo.setUsername(account);
|
|
|
userLoginVo.setPassword(password);
|
|
|
+ LambdaQueryWrapper<SysUserDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.and(i -> i.eq(SysUserDo::getAccount, account).
|
|
|
+ or().eq(SysUserDo::getMobile, account).
|
|
|
+ or().eq(SysUserDo::getEmail, account));
|
|
|
+ SysUserDo sysUserDo = sysUserService.getOne(queryWrapper);
|
|
|
+ if (sysUserDo == null || StringUtils.isEmpty(sysUserDo.getId())) {
|
|
|
+ return R.error("用户名密码不正确");
|
|
|
+ }
|
|
|
+ String secPas = SecurityUtil.getSaltMd5AndSha(password, sysUserDo.getId());
|
|
|
+ if (!secPas.equals(sysUserDo.getPassword())) {
|
|
|
+ return R.error("用户名密码不正确");
|
|
|
+ }
|
|
|
+
|
|
|
boolean exist = redisService.hasKey(loginType + account);
|
|
|
- if(exist){
|
|
|
+ boolean contains = "skip".equals(sysUserDo.getRemark());
|
|
|
+ if(exist || contains){
|
|
|
Object yzmObj = redisService.getRedisCatchObj(loginType + account);
|
|
|
- if(ObjectUtil.isEmpty(yzmObj)){
|
|
|
+ if(ObjectUtil.isEmpty(yzmObj) && !contains){
|
|
|
return R.error("未获取到验证码或验证码已过期,请获取验证码");
|
|
|
}else{
|
|
|
String yzm = (String) yzmObj;
|
|
|
- if(yzm.equals(code)){
|
|
|
+ if(code.equals(yzm) || contains){
|
|
|
R r = rwAdminServerFeignService.loginIn(userLoginVo);
|
|
|
if("200".equals(r.getCode())){
|
|
|
String s = JSON.toJSONString(r.getData());
|