Commit 1a78f99a authored by 何娜's avatar 何娜

taxapi 错误提示

parent d07e239d
Pipeline #7265 passed with stage
in 8 seconds
......@@ -26,4 +26,18 @@ module.exports = {
};
},
error(err = '') {
this.status = 200;
if (err.code === 'invalid_param') {
this.body = { code: -1, msg: '请求参数有误' };
return;
}
if (!/token|appKey/.test(err.message)) {
if (/[a-zA-Z]+/.test(err.message)) {
this.body = { code: err.code || -1, msg: '系统错误, 请稍后再试' };
return;
}
}
this.body = { code: err.code || -1, msg: err.message || '' };
}
};
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