| | |
| | | package com.ruoyi.common.utils.ip; |
| | | |
| | | import cn.hutool.core.lang.Dict; |
| | | import cn.hutool.core.net.NetUtil; |
| | | import cn.hutool.http.HtmlUtil; |
| | | import cn.hutool.http.HttpUtil; |
| | |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 获取地址类 |
| | |
| | | log.error("获取地理位置异常 {}", ip); |
| | | return UNKNOWN; |
| | | } |
| | | Map<String, String> obj = JsonUtils.parseMap(rspStr); |
| | | String region = obj.get("pro"); |
| | | String city = obj.get("city"); |
| | | Dict obj = JsonUtils.parseMap(rspStr); |
| | | String region = obj.getStr("pro"); |
| | | String city = obj.getStr("city"); |
| | | return String.format("%s %s", region, city); |
| | | } catch (Exception e) { |
| | | log.error("获取地理位置异常 {}", ip); |