fix ip查询

master
luoyang 5 years ago
parent a8a4600f9d
commit da1feec883

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

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

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

Loading…
Cancel
Save