|
@@ -134,13 +134,17 @@ public class SysRegisterService {
|
|
throw new CaptchaNullException();
|
|
throw new CaptchaNullException();
|
|
}
|
|
}
|
|
String verifyKey = CacheConstants.SMS_REGISTER_CODE_KEY + StringUtils.nvl(username, "");
|
|
String verifyKey = CacheConstants.SMS_REGISTER_CODE_KEY + StringUtils.nvl(username, "");
|
|
- String captcha = redisCache.getCacheObject(verifyKey).toString();
|
|
|
|
- redisCache.deleteObject(verifyKey);
|
|
|
|
- if (captcha == null) {
|
|
|
|
|
|
+ try {
|
|
|
|
+ String captcha = redisCache.getCacheObject(verifyKey).toString();
|
|
|
|
+ redisCache.deleteObject(verifyKey);
|
|
|
|
+ if (captcha == null) {
|
|
|
|
+ throw new CaptchaExpireException();
|
|
|
|
+ }
|
|
|
|
+ if (!code.equalsIgnoreCase(captcha)) {
|
|
|
|
+ throw new CaptchaException();
|
|
|
|
+ }
|
|
|
|
+ } catch (NullPointerException e) {
|
|
throw new CaptchaExpireException();
|
|
throw new CaptchaExpireException();
|
|
}
|
|
}
|
|
- if (!code.equalsIgnoreCase(captcha)) {
|
|
|
|
- throw new CaptchaException();
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|