diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy index 002e6aa14..9a3bc83d4 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/temp/shenjian/util/GaoDeUtils.groovy @@ -176,7 +176,7 @@ class GaoDeUtils { */ static def parserByGaode(def city, def address) { JSONObject json = GaoDeApiUtils.geo(city, address) - if (json && json.status == "1") { + if (json && json.info && json.info == "OK") { def ret = json.geocodes if (ret) { def str = ret.get(0).location @@ -184,6 +184,14 @@ class GaoDeUtils { def arrs = str.split(",") return ["lng": arrs[0], "lat": arrs[1]] } + } else if (json && json.infocode && json.infocode == "10044") { + System.exit(1) + } else if (json && json.infocode && json.infocode == "10004") { + // 开发者的单位时间内(1分钟)访问量超限,被系统自动封停,下一分钟自动解封。 + Thread.sleep(60000) + } else if (json && json.infocode && json.infocode == "10017") { + // 所请求的资源不可用 + System.exit(1) } } }