Przeglądaj źródła

fix 非官网获取验证码短信图形验证

zoujiajian 1 rok temu
rodzic
commit
98d1a17502

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/cps/CpsManageService.java

@@ -21,7 +21,7 @@ public interface CpsManageService {
 	 * @param cid 国家或地区id +86
 	 * @param login
 	 */
-	void getLoginCode(Integer type, String login, Integer cid);
+	void getLoginCode(Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr);
 
 	User login(Integer type, String login, String code);
 

+ 9 - 1
netflix-service/src/main/java/com/cyksj/service/cps/impl/CpsManageServiceImpl.java

@@ -23,11 +23,13 @@ import com.cyksj.model.views.CpsUserWMoneyStatisticsDataView;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.cps.CpsManageService;
 import com.cyksj.service.mail.MailService;
+import com.cyksj.service.user.BadIntentionOpService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /*
@@ -55,8 +57,12 @@ public class CpsManageServiceImpl implements CpsManageService {
 
 	private final CouponDistributePopularizeMapper couponDistributePopularizeMapper;
 
+	private final HttpServletRequest request;
+
+	private final BadIntentionOpService badIntentionOpService;
+
 	@Override
-	public void getLoginCode(Integer type, String login, Integer cid) {
+	public void getLoginCode(Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr) {
 		if (type > 2) {
 			throw BusinessRuntimeException.getInstance("");
 		}
@@ -81,6 +87,8 @@ public class CpsManageServiceImpl implements CpsManageService {
 			if (StrUtil.isEmpty(login) || (86 == cid && !Validator.isMobile(phone))) {
 				throw BusinessRuntimeException.getInstance("请输入正确的手机号");
 			}
+			//是否是恶意用户
+			badIntentionOpService.checkHandleBadUserOp(phone, verifyCode, ticket, randStr, request);
 			SmsUtil.sendTencent(cid, login, code);
 		} else if (type == 2) {
 			if (!Validator.isEmail(login)) {

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/cps/shop/YhShopManageService.java

@@ -23,7 +23,7 @@ public interface YhShopManageService {
 	 * @param cid 国家或地区id +86
 	 * @param login
 	 */
-	void getLoginCode(Integer type, String login, Integer cid);
+	void getLoginCode(Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr);
 
 	User login(Integer type, String login, String code);
 

+ 9 - 1
netflix-service/src/main/java/com/cyksj/service/cps/shop/YhShopManageServiceImpl.java

@@ -24,10 +24,12 @@ import com.cyksj.model.views.YhShopUserWMoneyStatisticsDataView;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.mail.MailService;
 import com.cyksj.service.pay.TransferFuncService;
+import com.cyksj.service.user.BadIntentionOpService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 import java.util.Optional;
 
@@ -56,8 +58,12 @@ public class YhShopManageServiceImpl implements YhShopManageService{
 
 	private final UserDistributeMapper userDistributeMapper;
 
+	private final HttpServletRequest request;
+
+	private final BadIntentionOpService badIntentionOpService;
+
 	@Override
-	public void getLoginCode(Integer type, String login, Integer cid) {
+	public void getLoginCode(Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr) {
 		if (type > 2) {
 			throw BusinessRuntimeException.getInstance("");
 		}
@@ -91,6 +97,8 @@ public class YhShopManageServiceImpl implements YhShopManageService{
 			if (StrUtil.isEmpty(login) || (86 == cid && !Validator.isMobile(phone))) {
 				throw BusinessRuntimeException.getInstance("请输入正确的手机号");
 			}
+			//是否是恶意用户
+			badIntentionOpService.checkHandleBadUserOp(phone, verifyCode, ticket, randStr, request);
 			SmsUtil.sendTencent(cid, login, code);
 		} else if (type == 2) {
 			if (!Validator.isEmail(login)) {

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mirrorshop/CmsUserMirrorShopService.java

@@ -16,7 +16,7 @@ import java.util.List;
  * 创建时间:2024/11/7 12:07
  */
 public interface CmsUserMirrorShopService {
-	void getLoginCode(Integer type, String login, Integer cid);
+	void getLoginCode(Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr);
 
 	String yhShopManageRedirect(long userId);
 

+ 10 - 2
netflix-service/src/main/java/com/cyksj/service/mirrorshop/impl/CmsUserMirrorShopServiceImpl.java

@@ -21,10 +21,12 @@ import com.cyksj.redis.RedisService;
 import com.cyksj.service.mail.MailService;
 import com.cyksj.service.mirrorshop.CmsUserMirrorShopService;
 import com.cyksj.service.pay.TransferFuncService;
+import com.cyksj.service.user.BadIntentionOpService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -49,8 +51,12 @@ public class CmsUserMirrorShopServiceImpl implements CmsUserMirrorShopService {
 
 	private final TransferFuncService transferFuncService;
 
+	private final HttpServletRequest request;
+
+	private final BadIntentionOpService badIntentionOpService;
+
 	@Override
-	public void getLoginCode(Integer type, String login, Integer cid) {
+	public void getLoginCode(Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr) {
 		if (type > 2) {
 			throw BusinessRuntimeException.getInstance("");
 		}
@@ -72,7 +78,7 @@ public class CmsUserMirrorShopServiceImpl implements CmsUserMirrorShopService {
 			throw BusinessRuntimeException.getInstance("您不是小店店铺主");
 		}
 
-		String CACHE_LOGIN_KEY = RedisService.key.USER_MIRROR_SHOP_BACK_LOGIN_KEY.getName()  + login;
+		String CACHE_LOGIN_KEY = RedisService.key.USER_MIRROR_SHOP_BACK_LOGIN_KEY.getName() + login;
 		Object o = redisService.get(CACHE_LOGIN_KEY);
 		Long expire = redisService.getExpire(CACHE_LOGIN_KEY);
 		if (o != null && expire >= 3 * 60 - 10) {
@@ -83,6 +89,8 @@ public class CmsUserMirrorShopServiceImpl implements CmsUserMirrorShopService {
 			if (StrUtil.isEmpty(login) || (86 == cid && !Validator.isMobile(phone))) {
 				throw BusinessRuntimeException.getInstance("请输入正确的手机号");
 			}
+			//是否是恶意用户
+			badIntentionOpService.checkHandleBadUserOp(phone, verifyCode, ticket, randStr, request);
 			SmsUtil.sendTencent(cid, login, code);
 		} else if (type == 2) {
 			if (!Validator.isEmail(login)) {

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/cps/CpsBackLoginController.java

@@ -89,8 +89,8 @@ public class CpsBackLoginController {
 	 */
 	@GetMapping("/get/LoginCode")
 	@NoSubmit
-	public Result getLoginCode(@RequestParam(defaultValue = "1") Integer type, String login, Integer cid) {
-		cpsManageService.getLoginCode(type, login, cid);
+	public Result getLoginCode(@RequestParam(defaultValue = "1") Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr) {
+		cpsManageService.getLoginCode(type, login, cid, verifyCode, ticket, randStr);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
 

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/shop/YhShopLoginController.java

@@ -65,8 +65,8 @@ public class YhShopLoginController {
 	 */
 	@GetMapping("/get/LoginCode")
 	@NoSubmit
-	public Result getLoginCode(@RequestParam(defaultValue = "1") Integer type, String login, Integer cid) {
-		yhShopManageService.getLoginCode(type, login, cid);
+	public Result getLoginCode(@RequestParam(defaultValue = "1") Integer type, String login, Integer cid, String verifyCode, String ticket, String randStr) {
+		yhShopManageService.getLoginCode(type, login, cid, verifyCode, ticket, randStr);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
 

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/mirrorshop/manage/CmsUserMirrorShopLoginController.java

@@ -66,8 +66,8 @@ public class CmsUserMirrorShopLoginController {
 	 */
 	@GetMapping("/get/LoginCode")
 	@NoSubmit
-	public Result getLoginCode(@RequestParam(defaultValue = "1") Integer type, String login, Integer cid) {
-		cmsUserMirrorShopService.getLoginCode(type, login, cid);
+	public Result getLoginCode(@RequestParam(defaultValue = "1") Integer type, String login, Integer cid, String verifyCode, String ticket, String randSt) {
+		cmsUserMirrorShopService.getLoginCode(type, login, cid, verifyCode, ticket, randSt);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}