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 {
contentType: 'json',
...opts,
};
// ctx.logger.info('_request', type, JSON.stringify(opts));
ctx.logger.info('_request', url, type);
return ctx.curl(url, opts);
}
_checkSuccess(result) {
if (result.status !== 200) {
const errorMsg = result.data && result.data.error_msg ? result.data.error_msg : 'unknown error';
this.ctx.throw(result.status, errorMsg);
}
// if (result.status !== 200) {
// const errorMsg = result.data && result.data.error_msg ? result.data.error_msg : 'unknown error';
// this.ctx.throw(result.status, errorMsg);
// }
if (result.data.code !== 0) {
this.ctx.throw(400, {message: result.data.msg, code: result.data.code});
}
......@@ -102,8 +102,8 @@ class TaskService extends Service {
let newCityMap = new Map();
const newret = await this._request(cityConfigUrl, 'gsgj', {method: 'get'});
ctx.logger.info(`【Task】getCityList ${cityConfigUrl} params gsgj`, JSON.stringify(newret));
// this._checkSuccess(newret);
ctx.logger.info(`【Task】getCityList params gsgj`, newret.status, newret.data.data.length);
this._checkSuccess(newret);
newret.data.data.map(Prov => {
Prov.citys.map(city => {
newCityMap.set(String(city.id), city)
......@@ -111,8 +111,8 @@ class TaskService extends Service {
});
const ret = await this._request(cityConfigUrl, '51gs', {method: 'get'});
ctx.logger.info(`【Task】getCityList ${cityConfigUrl} params 51gs`, JSON.stringify(newret));
// this._checkSuccess(ret);
ctx.logger.info(`【Task】getCityList params 51gs`, ret.status, ret.data.data.length);
this._checkSuccess(ret);
ret.data.data.map(Prov => {
let newProv = {provinceName: Prov.provinceName, citys: []};
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