修复ip空字符串引起的异常问题
pull/30/head
Chasel 2023-03-21 14:25:03 +08:00
parent 6d5f833c29
commit e618f8e404
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ public class AreaController {
@Parameter(name = "ip", description = "IP", required = true) @Parameter(name = "ip", description = "IP", required = true)
public CommonResult<String> getAreaByIp(@RequestParam("ip") String ip) { public CommonResult<String> getAreaByIp(@RequestParam("ip") String ip) {
// 获得城市 // 获得城市
Area area = IPUtils.getArea(ip); Area area = IPUtils.getArea(ip.trim());
if (area == null) { if (area == null) {
return success("未知"); return success("未知");
} }