Ver Fonte

Merge branch 'master' into pre

# Conflicts:
#	netflix-dao/src/main/resources/mapper/OrderDonMapper.xml
#	netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonSkuController.java
#	netflix-web/src/main/resources/application-dev.yml
#	netflix-web/src/main/resources/application-prd.yml
#	netflix-web/src/main/resources/application-pre.yml
zoujiajian há 2 anos atrás
pai
commit
ba924bb43d

+ 0 - 8
netflix-dao/src/main/resources/mapper/OrderDonMapper.xml

@@ -495,12 +495,4 @@
             #{item}
         </foreach>
     </select>
-
-    <select id="getPayGoodsIds" resultType="java.lang.Long">
-        select distinct goods_id from order_don where status not in ('close','noPayment')
-        and user_id in
-        <foreach collection="userIds" item="item" open="(" separator="," close=")">
-            #{item}
-        </foreach>
-    </select>
 </mapper>

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/user/BadIntentionOpService.java

@@ -3,7 +3,7 @@ package com.cyksj.service.user;
 import javax.servlet.http.HttpServletRequest;
 
 public interface BadIntentionOpService {
-    void checkHandleBadUserOp(HttpServletRequest request, String phone);
+    void checkHandleBadUserOp(String phone, String verifyCode);
 
     void isBadOpLoginPhone(HttpServletRequest request, String phone);
 }

+ 31 - 10
netflix-service/src/main/java/com/cyksj/service/user/impl/BadIntentionOpServiceImpl.java

@@ -1,20 +1,30 @@
 package com.cyksj.service.user.impl;
 
 import cn.hutool.extra.servlet.ServletUtil;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONObject;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.StringUtil;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.user.BadIntentionOpService;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.Map;
 
 @Service
 @RequiredArgsConstructor
 @Slf4j
 public class BadIntentionOpServiceImpl implements BadIntentionOpService {
+
+    @Value("${smsVerify.apikey}")
+    String apiKey;
+
     private final RedisService redisService;
 
     private static final int PHONE_CODE_GET_NUM_DAY_LIMIT = 30;
@@ -22,17 +32,28 @@ public class BadIntentionOpServiceImpl implements BadIntentionOpService {
 
     private static final int PHONE_LOGIN_CODE_RETRY = 10;
 
+    private static final String VERIFY_URL =  "https://captcha.luosimao.com/api/site_verify";
+
     @Override
-    public void checkHandleBadUserOp(HttpServletRequest request, String phone) {
+    public void checkHandleBadUserOp(String phone, String verifyCode) {
         if ("13662979985".equals(phone)) {
             throw BusinessRuntimeException.getInstance("异常手机号");
         }
-        String clientIP = ServletUtil.getClientIP(request);
-        String ipAddress = StringUtil.getInternalAddressByIP(clientIP);
-        log.info("--------------获取手机验证码------- ip:{} address:{}", clientIP, ipAddress);
+        if (StringUtils.isBlank(verifyCode)) {
+            throw BusinessRuntimeException.getInstance("人机校验不通过");
+        }else {
+            Map<String, Object> parmas = new HashMap<>();
+            parmas.put("api_key", apiKey);
+            parmas.put("response", verifyCode);
+            String post = HttpUtil.post(VERIFY_URL, parmas);
+            JSONObject res = new JSONObject(post);
+            if (!res.getStr("res").equals("success")) {
+                log.error("手机号:{}验证码校验不通过 res:{}", phone, res);
+                throw BusinessRuntimeException.getInstance("人机校验不通过");
+            }
+        }
         String dayKey = RedisService.key.PHONE_CODE_USER_NUM_KEY_DAY.getName() + phone;
         if (redisService.hasKey(RedisService.key.PHONE_CODE_BALCK_KEY.getName() + phone)) {
-            log.error("--------------黑名单 手机号------- ip:{} address:{}", clientIP, ipAddress);
             throw BusinessRuntimeException.getInstance("异常手机号");
         }
         if (redisService.hasKey(dayKey)) {
@@ -49,14 +70,14 @@ public class BadIntentionOpServiceImpl implements BadIntentionOpService {
             return;
         }
         redisService.set(dayKey, 1, RedisService.key.PHONE_CODE_USER_NUM_KEY_DAY.getTimeout());
+
     }
 
     @Override
     public void isBadOpLoginPhone(HttpServletRequest request, String phone) {
-        String clientIP = ServletUtil.getClientIP(request);
-        String ipAddress = StringUtil.getInternalAddressByIP(clientIP);
-        log.info("--------------校验ip 是否黑名单------- ip:{} ipAddress:{}", clientIP, ipAddress);
-        String blackIpKey = RedisService.key.BALCK_USER_IP_KEY + clientIP;
+        String ip = StringUtil.getInternalAddressByIP(ServletUtil.getClientIP(request));
+        log.info("--------------校验ip 是否黑名单------- ip:{}", ip);
+        String blackIpKey = RedisService.key.BALCK_USER_IP_KEY + ip;
         if (redisService.hasKey(blackIpKey)) {
             throw BusinessRuntimeException.getInstance("检测到您操作异常,请联系客服");
         }
@@ -65,7 +86,7 @@ public class BadIntentionOpServiceImpl implements BadIntentionOpService {
             int i = Integer.parseInt(redisService.get(RetryTimeKey).toString());
             if (i >= PHONE_LOGIN_CODE_RETRY) {
                 //锁住他的ip
-                redisService.setNx(blackIpKey, clientIP, RedisService.key.BALCK_USER_IP_KEY.getTimeout());
+                redisService.setNx(blackIpKey, ip, RedisService.key.BALCK_USER_IP_KEY.getTimeout());
                 throw BusinessRuntimeException.getInstance("检测到您操作异常,请联系客服");
             } else {
                 redisService.incr(RetryTimeKey, 1l);

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/CmsGoodsDonSkuController.java

@@ -254,7 +254,7 @@ public class CmsGoodsDonSkuController {
         goodsDonSkuService.update(null, Wrappers.lambdaUpdate(GoodsDonSku.class)
                 .eq(GoodsDonSku::getId, id)
                 .set(GoodsDonSku::getSorted, sorted));
-       refreshCacheService.refreshYhHomePageCache();
+        refreshCacheService.refreshYhHomePageCache();
         return GatewayResponse.SUCCESS.newBuilder().toResult();
     }
 }

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/user/AuthorizationController.java

@@ -365,7 +365,7 @@ public class AuthorizationController {
      */
     @GetMapping("/get/phone/code")
     @NoSubmit
-    public Result<String> getPhoneCode(String phone, Integer digit, @RequestParam(defaultValue = "0") Boolean isFree, Integer cid) throws Exception {
+    public Result<String> getPhoneCode(String phone, Integer digit, @RequestParam(defaultValue = "0") Boolean isFree, Integer cid, String verifyCode) throws Exception {
         if (cid == null) cid = 86;
         if (StrUtil.isBlank(phone) || (86 == cid && !Validator.isMobile(phone))) {
             throw BusinessRuntimeException.getInstance("请输入正确的手机号");
@@ -379,7 +379,7 @@ public class AuthorizationController {
             throw BusinessRuntimeException.getInstance("短信验证码未失效");
         }
         //是否是恶意用户
-        badIntentionOpService.checkHandleBadUserOp(request, phone);
+        badIntentionOpService.checkHandleBadUserOp(phone, verifyCode);
         String code = StringUtil.getRandomCodeStr(digit);
         Boolean isFlag;
         if (!isFree) {

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
netflix-web/src/main/resources/application-dev.yml


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
netflix-web/src/main/resources/application-prd.yml


+ 10 - 12
netflix-web/src/main/resources/application-pre.yml

@@ -123,7 +123,7 @@ wechat:
   oldAppid: wxd58016eee53b6558
   appid: wx6cbc2de2a55e5579
   secret: 2ab6340e7787ab24de9f29094dee9d24
-  domain: https://nf.video/8082/api/
+  domain: https://nf.video/8081/api/
   #默认微信商户
   shopid: 1634772026
   shopKey: p2B8BAKi2V3PgMDSSez82V67aIvMKBt5
@@ -145,7 +145,7 @@ wx-login:
 wx-shop-login:
   appid: wx7c5494c38c6a78bd #todo
   secret: 95c7c542a583b42840765d758ec49bf5 #todo
-  redirectUri: https://shop.liuliangbang.vip/8082/api/auth/wx/authLogin/baseRedirect
+  redirectUri: https://shop.liuliangbang.vip/8081/api/auth/wx/authLogin/baseRedirect
   loginUrl: https://shop.liuliangbang.vip/
   remark: 小店店铺网页微信授权
 
@@ -154,25 +154,20 @@ yhlx:
   corpSecret: Ov0mlArSItBrs9EuOMt5Ou_faGdplDDIvPgIhgup51E
   encodingAESKey: bqoACJutQEgW7KOgBoezuQkk7y2HQSyRp1sQ8qnAi6C
   token: 2e0aWIfBewWNN5BNMq9cBeLf9x
-  domain: https://nf.video/8082/api/
+  domain: https://nf.video/8081/api/
 
 #银河录像局小程序
 yhmini:
   appid: wx383c483d3bcf155a
   secret: bf6ca029a3102f390486a7a14b218b06
 
-#银河录像局大学生认证小程序
-certmini:
-  appid: wx16e441d61fa3fd8a
-  secret: edc2e8ed29a45d6ba266a63bc7ffc2b5
-
 #广告投放小程序
 advertisement:
   appId: wx895f960ea6b8c5d0
   secret: 19b5f5121bc7cc1bc010ee7c4ac509e9
   shopId: 1644299849
   shopKey: 5y5ZScTJGm0q0umHQOD4r3EfjRvCioUx
-  notify: https://nf.video/8082/api/
+  notify: https://nf.video/8081/api/
 
 #广告投放公众号
 advertisementwxapp:
@@ -180,9 +175,12 @@ advertisementwxapp:
   secret: 44c1e7431099fc0bd21dc320822b0108
   shopId: 1644299849
   shopKey: 5y5ZScTJGm0q0umHQOD4r3EfjRvCioUx
-  notify: https://xue.niupian.com.cn/8082/api/
+  notify: https://xue.niupian.com.cn/8081/api/
 
 chatgpt:
-  domain: "https://gpt.claudeplus.com.cn"
+  domain: "https://gpt.galaxydvd.com"
   car:
-    domain: "https://car.galaxydvd.com"
+    domain: "https://car.galaxydvd.com"
+
+smsVerify:
+  apikey: bc0737b7339ab0f275f954a161fdb313

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff