mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
新增内网ip判断,内网返回所属地为"未知"
This commit is contained in:
+5
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.framework.ip.core.service.imp;
|
||||
|
||||
import cn.hutool.core.net.NetUtil;
|
||||
import cn.hutool.core.text.CharSequenceUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
@@ -35,6 +36,10 @@ public class IPQueryServiceImpl implements IPQueryService {
|
||||
|
||||
@Override
|
||||
public IPQueryDataRespDTO querySource(String ip) {
|
||||
// 校验是否内部ip
|
||||
if (NetUtil.isInnerIP(ip)) {
|
||||
return new IPQueryDataRespDTO().setIp(ip).setProv("未知");
|
||||
}
|
||||
ErrorCode queryError = ErrorCodeConstants.IP_QUERY_ERROR;
|
||||
try {
|
||||
String apiUrl = ipQueryProperties.getApiUrl();
|
||||
|
||||
Reference in New Issue
Block a user