fixed: 需要登录的api的跨域问题

This commit is contained in:
none
2023-03-02 17:51:08 +08:00
parent 751516807f
commit 64d10d961c
5 changed files with 12 additions and 22 deletions

View File

@@ -72,14 +72,14 @@ public class IpUtil {
try {
String rspStr = HttpUtil.sendGet(IP_URL, "ip=" + ip + "&json=true", "GBK");
if (StringUtil.isEmpty(rspStr)) {
log.error("获取地理位置异常 {}", ip);
log.error("获取地理位置异常1 {}", ip);
return UNKNOWN;
}
ObjectMapper objectMapper = new ObjectMapper();
Response obj = objectMapper.readValue(rspStr, Response.class);
return String.format("%s-%s", obj.getPro(), obj.getCity());
} catch (Exception e) {
log.error("获取地理位置异常 {}", ip);
log.error("获取地理位置异常2 {} msg {}", ip, e.getMessage());
}
return UNKNOWN;