Просмотр исходного кода

交友-ip-v0.02

(cherry picked from commit b21b5768ca65c52a5607dd7bec8b0f89a0173bb4)
MOKASZ\lw12420 2 лет назад
Родитель
Сommit
2d262e1f4b

+ 18 - 18
launch-admin/src/main/java/com/webflux/launchadmin/mysql/controller/planNew/PlanNewCommonOutController.java

@@ -132,25 +132,25 @@ public class PlanNewCommonOutController {
                 List<Material> materialList = tuple.getT4();
                 if (!materialList.isEmpty()) {
                     Material material = materialList.get(RandomUtil.randomInt(0, materialList.size()));
-                    String clientIP = exchange.getRequest().getHeaders().getFirst("X-Forwarded-For");
-                    if ((clientIP == null || clientIP.isEmpty()) && Objects.nonNull(exchange.getRequest().getRemoteAddress())) {
-                        clientIP = exchange.getRequest().getRemoteAddress().getAddress().getHostAddress();
-                    }
                     String content = material.content();
-                    if (StrUtil.isNotBlank(clientIP)) {
-                        JSONObject ipInfo = ipAnalyzeServiceInterface.getIpInfo(clientIP);
-                        if (null != ipInfo) {
-                            String city = ipInfo.getStr("city");
-                            if (StrUtil.isNotBlank(city)) {
-                                content = city + content;
-                            } else {
-                                String province = ipInfo.getStr("region");
-                                if (StrUtil.isNotBlank(province)) {
-                                    content = province + content;
-                                }
-                            }
-                        }
-                    }
+//                    String clientIP = exchange.getRequest().getHeaders().getFirst("X-Forwarded-For");
+//                    if ((clientIP == null || clientIP.isEmpty()) && Objects.nonNull(exchange.getRequest().getRemoteAddress())) {
+//                        clientIP = exchange.getRequest().getRemoteAddress().getAddress().getHostAddress();
+//                    }
+//                    if (StrUtil.isNotBlank(clientIP)) {
+//                        JSONObject ipInfo = ipAnalyzeServiceInterface.getIpInfo(clientIP);
+//                        if (null != ipInfo) {
+//                            String city = ipInfo.getStr("city");
+//                            if (StrUtil.isNotBlank(city)) {
+//                                content = city + content;
+//                            } else {
+//                                String province = ipInfo.getStr("region");
+//                                if (StrUtil.isNotBlank(province)) {
+//                                    content = province + content;
+//                                }
+//                            }
+//                        }
+//                    }
                     h5ImageAndText.setName(content);
                     h5ImageAndText.setRemark(material.remark());
                 }