huanghongfa
2021-09-02 177249c76aeea0b4bf8d8816d4994e3b445b45ce
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/IPUtil.java
@@ -6,15 +6,11 @@
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.http.HttpServletRequest;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
/**
 * @ClassName: IPUtil
@@ -28,11 +24,10 @@
@Slf4j
public class IPUtil {
    /**
     *
     * 描述:获取IP地址
     *
     * @author huaping hu
     * @date 2016年6月1日下午5:25:44
     * @param request
@@ -57,10 +52,10 @@
        return ip;
    }
    /**
     *
     * 描述:获取IP+[IP所属地址]
     *
     * @author huaping hu
     * @date 2016年6月1日下午6:01:09
     * @param request
@@ -73,9 +68,11 @@
        return ip + belongIp;
    }
    /**
     *
     * 描述:获取IP所属地址
     *
     * @author huaping hu
     * @date 2016年6月1日下午5:59:43
     * @param ip
@@ -99,9 +96,11 @@
        }
        return ipAddress;
    }
    /**
     *
     * 描述:获取Ip所属地址
     *
     * @author huaping hu
     * @date 2016年6月1日下午5:38:55
     * @param urlStr
@@ -133,6 +132,7 @@
    /**
     *
     * 描述:将InputStream转换成String
     *
     * @author huaping hu
     * @date 2016年6月1日下午5:51:53
     * @param is
@@ -143,7 +143,8 @@
        String tempStr = "";
        try {
            if(is == null) return null;
            if (is == null)
                return null;
            ByteArrayOutputStream arrayOut = new ByteArrayOutputStream();
            byte[] by = new byte[1024];
            int len = 0;
@@ -159,7 +160,6 @@
    }
    public static void main(String[] args) {
        String context = call("http://ip.taobao.com/service/getIpInfo.php?ip=120.192.182.1");