fix ip查询

master
luoyang 5 years ago
parent a8a4600f9d
commit da1feec883

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.2.18</version>
<version>1.2.19</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -14,8 +14,9 @@ public class IPController {
private LookupService lookupService;
@GetMapping("/{ipAddr}")
public String getIpInfo(@PathVariable String ipAddr) {
String city = lookupService.getLocation(ipAddr).city;
return city;
public JSONObject getIpInfo(@PathVariable String ipAddr) {
JSONObject result = new JSONObject();
result.put("city", lookupService.getLocation(ipAddr).city);
return result;
}
}

@ -41,7 +41,7 @@ define(['../app'], function (app) {
$scope.order = order.data;
$scope.getPayLocation=function (ip) {
$http.get('/dev/ip/'+ip).then(function (res) {
$scope.pay_location = res.data;
$scope.pay_location = res.data.city;
})
}
}]);

Loading…
Cancel
Save