Explorar el Código

fix 绑定手机号校验是否过滤ip

zoujiajian hace 2 años
padre
commit
87808054a9

+ 7 - 5
netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java

@@ -578,7 +578,7 @@ public class OrderController {
      * 是否绑定了邮箱或手机号
      */
     @GetMapping("/isBind")
-    public Result<Boolean> isBindPhoneOrEmail() {
+    public Result<Boolean> isBindPhoneOrEmail(@RequestParam(defaultValue = "1") Boolean fip) {
         Long userId = StpUserUtil.getLoginIdAsLong();
         User user = userMapper.selectById(userId);
         if (user == null) {
@@ -592,10 +592,12 @@ public class OrderController {
         UserBindDetail userBindDetail = userBindDetailMapper.selectOne(Wrappers.lambdaQuery(UserBindDetail.class)
                 .eq(StrUtil.isNotEmpty(user.getOpenId()), UserBindDetail::getUserId, userId)
                 .eq(StrUtil.isNotEmpty(user.getEmail()), UserBindDetail::getEmailUserId, userId).last("limit 1"));
-        //台湾ip
-        String address = StringUtil.getNewInternalAddressByIp(ServletUtil.getClientIP(request));
-        if (address.contains("台湾") || !address.contains("中国")) {
-            return GatewayResponse.SUCCESS.newBuilder().toResult(true);
+        if (fip) {
+            //台湾ip
+            String address = StringUtil.getNewInternalAddressByIp(ServletUtil.getClientIP(request));
+            if (address.contains("台湾") || !address.contains("中国")) {
+                return GatewayResponse.SUCCESS.newBuilder().toResult(true);
+            }
         }
         if (userBindDetail == null || StrUtil.isEmpty(userBindDetail.getPhone())) {
             return GatewayResponse.SUCCESS.newBuilder().toResult(false);