|
@@ -312,16 +312,22 @@ public class MdeEnterpriseAuthServiceImpl implements MdeEnterpriseAuthService {
|
|
|
|
|
|
@Override
|
|
|
public void resetPassword(AppEnterpriseResetPasswordReqVO reqVO) {
|
|
|
- if (captchaEnable) {
|
|
|
- // 校验验证码
|
|
|
- ValidationUtils.validate(validator, reqVO, AppEnterpriseResetPasswordReqVO.CodeEnableGroup.class);
|
|
|
- CaptchaVO captchaVO = new CaptchaVO();
|
|
|
- captchaVO.setCaptchaVerification(reqVO.getCaptchaVerification());
|
|
|
- ResponseModel response = captchaService.verification(captchaVO);
|
|
|
- // 验证不通过
|
|
|
- if (!response.isSuccess()) {
|
|
|
- // 创建登录失败日志(验证码不正确)
|
|
|
- throw exception(MDE_AUTH_LOGIN_CAPTCHA_CODE_ERROR, response.getRepMsg());
|
|
|
+ String userAgent = Objects.requireNonNull(ServletUtils.getUserAgent()).toLowerCase();
|
|
|
+ if (!userAgent.contains("micromessenger")
|
|
|
+ && !userAgent.contains("wechatdevtools")
|
|
|
+ && !userAgent.contains("miniprogram")) {
|
|
|
+ // 不是小程序登录要验证图形
|
|
|
+ if (captchaEnable) {
|
|
|
+ // 校验验证码
|
|
|
+ ValidationUtils.validate(validator, reqVO, AppEnterpriseResetPasswordReqVO.CodeEnableGroup.class);
|
|
|
+ CaptchaVO captchaVO = new CaptchaVO();
|
|
|
+ captchaVO.setCaptchaVerification(reqVO.getCaptchaVerification());
|
|
|
+ ResponseModel response = captchaService.verification(captchaVO);
|
|
|
+ // 验证不通过
|
|
|
+ if (!response.isSuccess()) {
|
|
|
+ // 创建登录失败日志(验证码不正确)
|
|
|
+ throw exception(MDE_AUTH_LOGIN_CAPTCHA_CODE_ERROR, response.getRepMsg());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
Object code = redisTemplate.opsForValue().get(reqVO.getEmail());
|