1
zj
2024-07-29 65a582719d841041178429119a9f5817758eb816
websocketSerivce/src/main/java/org/example/util/IpAddressUtil.java
@@ -31,7 +31,7 @@
public class IpAddressUtil  {
    // ip2region.xdb 文件地址常量(本地xdb文件路径)
    public static String XDB_PATH = "D:\\项目\\demo\\websocketSerivce\\src\\main\\resources\\ip\\csdn-ip2region.xdb";
    public static String XDB_PATH = PropertiesUtil.getProperty("XDB_PATH");
    /**
     * 获取IP地址:
@@ -105,6 +105,7 @@
                //log.info("{地区: {}, IO操作数: {}, 耗时: {} μs}", region, searcher.getIOCount(), cost);
                return region;
            } catch (Exception e) {
                e.printStackTrace();
                log.error("获取IP地址异常:{} ", e.getMessage());
                throw new RuntimeException("获取IP地址异常");
            }