调整ip工具类
This commit is contained in:
@@ -2,7 +2,6 @@ package xtools.boot.core.utils;
|
||||
|
||||
import xtools.base.config.BaseParams;
|
||||
import xtools.core.StringUtils;
|
||||
import xtools.core.encrypt.Md5Utils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -45,23 +44,4 @@ public class AddrUtils implements BaseParams {
|
||||
return LOCAL_IP_LIST.contains(ip);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据IP地址获取通用地址code
|
||||
*
|
||||
* @param country 国家
|
||||
* @param province 省份
|
||||
* @param city 城市
|
||||
* @return 通用地址code
|
||||
*/
|
||||
public static String getCode(String country, String province, String city) {
|
||||
String code = country;
|
||||
if (StringUtils.isNotBlank(province)) {
|
||||
code += CP_LINE + province;
|
||||
}
|
||||
if (StringUtils.isNotBlank(city)) {
|
||||
code += CP_LINE + city;
|
||||
}
|
||||
return Md5Utils.encryptToString(code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user