|
|
@@ -1,6 +1,5 @@
|
|
|
package com.cyksj.service.user.impl;
|
|
|
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.extra.servlet.ServletUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
@@ -56,13 +55,7 @@ public class BadIntentionOpServiceImpl implements BadIntentionOpService {
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
- if (ObjectUtil.hasEmpty(ticket, randStr)) {
|
|
|
- throw BusinessRuntimeException.getInstance("请先完成图形认证");
|
|
|
- } else {
|
|
|
- //腾讯云图形验证
|
|
|
- String ip = ServletUtil.getClientIP(request);
|
|
|
- SmsUtil.checkTencentCaptcha(ticket, ip, randStr);
|
|
|
- }
|
|
|
+ checkCaptcha(ticket, randStr, request);
|
|
|
String dayKey = RedisService.key.PHONE_CODE_USER_NUM_KEY_DAY.getName() + phone;
|
|
|
if (redisService.hasKey(RedisService.key.PHONE_CODE_BALCK_KEY.getName() + phone)) {
|
|
|
throw BusinessRuntimeException.getInstance("异常手机号");
|
|
|
@@ -84,6 +77,14 @@ public class BadIntentionOpServiceImpl implements BadIntentionOpService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void checkCaptcha(String ticket, String randStr, HttpServletRequest request) {
|
|
|
+ if (cn.hutool.core.util.StrUtil.isBlank(ticket) || cn.hutool.core.util.StrUtil.isBlank(randStr)) {
|
|
|
+ throw BusinessRuntimeException.getInstance("请先完成图形认证");
|
|
|
+ }
|
|
|
+ SmsUtil.checkTencentCaptcha(ticket, ServletUtil.getClientIP(request), randStr);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void isBadOpLoginPhone(HttpServletRequest request, String phone) {
|
|
|
String ip = ServletUtil.getClientIP(request);
|