update 优化代码生成 使用新 JsonUtils.parseMap 方法

This commit is contained in:
疯狂的狮子li
2022-02-15 12:07:56 +08:00
parent 657b6a9fae
commit 54f5b59c8c
3 changed files with 23 additions and 23 deletions

View File

@ -1,5 +1,6 @@
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;
@ -11,8 +12,6 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
/**
* 获取地址类
*
@ -48,9 +47,9 @@ public class AddressUtils {
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);