Commit 36e0828b authored by 何娜's avatar 何娜

taxh5回调

parent cfeaf78e
Pipeline #6800 passed with stage
in 2 seconds
...@@ -68,6 +68,10 @@ class OrderController extends Controller { ...@@ -68,6 +68,10 @@ class OrderController extends Controller {
if (orderId) { if (orderId) {
await service.order.update(object); await service.order.update(object);
} else { } else {
if (!userId) {
ctx.throw(422, { message: '请输入userId' });
return;
}
object.orderId = ctx.helper.getUuid(); object.orderId = ctx.helper.getUuid();
await service.order.create(object); await service.order.create(object);
} }
......
...@@ -90,8 +90,10 @@ class TaskController extends Controller { ...@@ -90,8 +90,10 @@ class TaskController extends Controller {
const {ctx, service} = this; const {ctx, service} = this;
ctx.logger.info('【handleCallback】', ctx.request.body); ctx.logger.info('【handleCallback】', ctx.request.body);
const {taskId} = ctx.request.body; const {taskId} = ctx.request.body;
ctx.body = {
code: '0',
};
const result = await service.task.fetchTask({taskId}); const result = await service.task.fetchTask({taskId});
ctx.success();
let taskNote = { let taskNote = {
status: 'init', status: 'init',
note: {message: 'init'}, note: {message: 'init'},
......
...@@ -26,4 +26,19 @@ module.exports = { ...@@ -26,4 +26,19 @@ module.exports = {
}; };
}, },
error(err = '') {
this.status = 200;
if (err.code === 'invalid_param') {
this.body = { code: -1, msg: '请求参数有误' };
return;
}
if (!/token/.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