提交代码

dev-discount
胡锐 2 years ago
parent 9dfac24d77
commit a2c34b5ee4
  1. 13
      hai-service/src/main/java/com/hai/common/utils/BaiduUtils.java

@ -22,13 +22,16 @@ public class BaiduUtils {
*/
public static JSONObject ipLocation(String ip) {
System.out.println(ip);
if (ip != null) {
JSONObject response = HttpsUtils.doGet("https://api.map.baidu.com/location/ip?ak=X4sSdXsohVOMb1tNiLZloD9ows5FaNjq&ip=" + ip);
return response;
} else {
try {
if (ip != null) {
JSONObject response = HttpsUtils.doGet("https://api.map.baidu.com/location/ip?ak=X4sSdXsohVOMb1tNiLZloD9ows5FaNjq&ip=" + ip);
return response;
} else {
return null;
}
} catch (Exception e) {
return null;
}
}
}

Loading…
Cancel
Save