| | |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.utils.JsonUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Map; |
| | |
| | | * @author Lion Li |
| | | */ |
| | | @Slf4j |
| | | @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| | | public class AddressUtils { |
| | | |
| | | // IP地址查询 |
| | |
| | | if (RuoYiConfig.isAddressEnabled()) { |
| | | try { |
| | | String rspStr = HttpUtil.createGet(IP_URL) |
| | | .body("ip=" + ip + "&json=true", Constants.GBK) |
| | | .execute() |
| | | .body(); |
| | | .body("ip=" + ip + "&json=true", Constants.GBK) |
| | | .execute() |
| | | .body(); |
| | | if (StringUtils.isEmpty(rspStr)) { |
| | | log.error("获取地理位置异常 {}", ip); |
| | | return UNKNOWN; |