Commit 99317713 authored by 何娜's avatar 何娜

tax

parent 4231eaf5
Pipeline #4470 passed with stage
in 4 seconds
...@@ -28,15 +28,15 @@ class TaskService extends Service { ...@@ -28,15 +28,15 @@ class TaskService extends Service {
contentType: 'json', contentType: 'json',
...opts, ...opts,
}; };
// ctx.logger.info('_request', type, JSON.stringify(opts)); ctx.logger.info('_request', url, type);
return ctx.curl(url, opts); return ctx.curl(url, opts);
} }
_checkSuccess(result) { _checkSuccess(result) {
if (result.status !== 200) { // if (result.status !== 200) {
const errorMsg = result.data && result.data.error_msg ? result.data.error_msg : 'unknown error'; // const errorMsg = result.data && result.data.error_msg ? result.data.error_msg : 'unknown error';
this.ctx.throw(result.status, errorMsg); // this.ctx.throw(result.status, errorMsg);
} // }
if (result.data.code !== 0) { if (result.data.code !== 0) {
this.ctx.throw(400, {message: result.data.msg, code: result.data.code}); this.ctx.throw(400, {message: result.data.msg, code: result.data.code});
} }
...@@ -102,8 +102,8 @@ class TaskService extends Service { ...@@ -102,8 +102,8 @@ class TaskService extends Service {
let newCityMap = new Map(); let newCityMap = new Map();
const newret = await this._request(cityConfigUrl, 'gsgj', {method: 'get'}); const newret = await this._request(cityConfigUrl, 'gsgj', {method: 'get'});
ctx.logger.info(`【Task】getCityList ${cityConfigUrl} params gsgj`, JSON.stringify(newret)); ctx.logger.info(`【Task】getCityList params gsgj`, newret.status, newret.data.data.length);
// this._checkSuccess(newret); this._checkSuccess(newret);
newret.data.data.map(Prov => { newret.data.data.map(Prov => {
Prov.citys.map(city => { Prov.citys.map(city => {
newCityMap.set(String(city.id), city) newCityMap.set(String(city.id), city)
...@@ -111,8 +111,8 @@ class TaskService extends Service { ...@@ -111,8 +111,8 @@ class TaskService extends Service {
}); });
const ret = await this._request(cityConfigUrl, '51gs', {method: 'get'}); const ret = await this._request(cityConfigUrl, '51gs', {method: 'get'});
ctx.logger.info(`【Task】getCityList ${cityConfigUrl} params 51gs`, JSON.stringify(newret)); ctx.logger.info(`【Task】getCityList params 51gs`, ret.status, ret.data.data.length);
// this._checkSuccess(ret); this._checkSuccess(ret);
ret.data.data.map(Prov => { ret.data.data.map(Prov => {
let newProv = {provinceName: Prov.provinceName, citys: []}; let newProv = {provinceName: Prov.provinceName, citys: []};
Prov.citys.map(city => { Prov.citys.map(city => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment