|
|
@@ -71,9 +71,15 @@ public class IPApiController {
|
|
|
apiDetail.setCountry(country);
|
|
|
String province = split[1];
|
|
|
apiDetail.setProvince(province);
|
|
|
- String carrier = split[split.length - 1];
|
|
|
- apiDetail.setCarrier(carrier);
|
|
|
- String city = result.replace(country, "").replace(province, "").replace(carrier, "").trim();
|
|
|
+ String city = null;
|
|
|
+ if (split.length > 3) {
|
|
|
+ String carrier = split[split.length - 1];
|
|
|
+ apiDetail.setCarrier(carrier);
|
|
|
+ city = result.replace(country, "").replace(province, "").replace(carrier, "").trim();
|
|
|
+ } else {
|
|
|
+ city = split[2];
|
|
|
+ apiDetail.setCarrier("");
|
|
|
+ }
|
|
|
apiDetail.setCity(city);
|
|
|
return apiDetail;
|
|
|
} else {
|