正在显示
1 个修改的文件
包含
4 行增加
和
0 行删除
| @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; | @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; | ||
| 5 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
| 6 | import com.ruoyi.common.utils.StringUtils; | 6 | import com.ruoyi.common.utils.StringUtils; |
| 7 | import com.ruoyi.common.utils.http.HttpUtils; | 7 | import com.ruoyi.common.utils.http.HttpUtils; |
| 8 | +import com.ruoyi.framework.config.RuoYiConfig; | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * 获取地址类 | 11 | * 获取地址类 |
| @@ -25,6 +26,8 @@ public class AddressUtils | @@ -25,6 +26,8 @@ public class AddressUtils | ||
| 25 | { | 26 | { |
| 26 | return "内网IP"; | 27 | return "内网IP"; |
| 27 | } | 28 | } |
| 29 | + if (RuoYiConfig.isAddressEnabled()) | ||
| 30 | + { | ||
| 28 | String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip); | 31 | String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip); |
| 29 | if (StringUtils.isEmpty(rspStr)) | 32 | if (StringUtils.isEmpty(rspStr)) |
| 30 | { | 33 | { |
| @@ -36,6 +39,7 @@ public class AddressUtils | @@ -36,6 +39,7 @@ public class AddressUtils | ||
| 36 | String region = data.getString("region"); | 39 | String region = data.getString("region"); |
| 37 | String city = data.getString("city"); | 40 | String city = data.getString("city"); |
| 38 | address = region + " " + city; | 41 | address = region + " " + city; |
| 42 | + } | ||
| 39 | return address; | 43 | return address; |
| 40 | } | 44 | } |
| 41 | } | 45 | } |
-
请 注册 或 登录 后发表评论