Commit 46a16952 authored by RuoYi's avatar RuoYi

修复地址开关无效问题

parent b7107a4d
...@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; ...@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils; import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.framework.config.RuoYiConfig;
/** /**
* 获取地址类 * 获取地址类
...@@ -25,6 +26,8 @@ public class AddressUtils ...@@ -25,6 +26,8 @@ public class AddressUtils
{ {
return "内网IP"; return "内网IP";
} }
if (RuoYiConfig.isAddressEnabled())
{
String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip); String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip);
if (StringUtils.isEmpty(rspStr)) if (StringUtils.isEmpty(rspStr))
{ {
...@@ -36,6 +39,7 @@ public class AddressUtils ...@@ -36,6 +39,7 @@ public class AddressUtils
String region = data.getString("region"); String region = data.getString("region");
String city = data.getString("city"); String city = data.getString("city");
address = region + " " + city; address = region + " " + city;
}
return address; return address;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment