Commit 0185df87 authored by 何娜's avatar 何娜

调试提示

parent 334a23b9
......@@ -77,11 +77,6 @@ class TaskController extends Controller {
password: md5(args.password) || '',
},
}, { orderId, taskId: task_id });
// service.cache.set({
// key: String(task_id) + data.data.orderId,
// value: { status: 'login', note: { message: 'login' } },
// });
// ctx.success({ errcode: 0, taskId: task_id });
ctx.success({ errcode: 0, data: { task_id } });
}
......@@ -226,10 +221,6 @@ class TaskController extends Controller {
};
ctx.logger.info('【handleCallback】 fetchTask')
const result = await service.task.fetchTask({ taskId });
// let taskNote = {
// status: 'init',
// note: { message: 'init' },
// };
switch (result.code) {
case -1:
service.order.update({
......@@ -237,27 +228,13 @@ class TaskController extends Controller {
note: result,
}, { orderId, taskId });
ctx.success({ errcode: 1, data: { state: -1, result: '服务器出错,请稍后重试' } });
// taskNote = {
// status: 'failure',
// note: { message: result.msg },
// };
break;
case 1:
// if (result.data.data) {
// result.data = {
// data: JSON.parse(JSON.parse(result.data.data).post_data.strForNextStep),
// loginParam: result.data.loginParam,
// };
// }
service.order.update({
status: 'next',
note: result,
}, { orderId, taskId });
ctx.success({ errcode: 0, data: { state: 1, html: service.index.getSMSHTML() } });
// taskNote = {
// status: 'next',
// note: { message: 'waiting', nextStep: result.data },
// };
break;
case 110:
service.order.update({
......@@ -265,16 +242,8 @@ class TaskController extends Controller {
note: result,
}, { orderId, taskId });
ctx.success({ errcode: 0, data: { state: 5, result: '更改为Query' } });
// taskNote = {
// status: 'query',
// note: { message: 'submit success' },
// };
break;
case 0:
// taskNote = {
// status: 'wash',
// note: { message: 'wash' },
// };
try {
service.order.update({
status: 'wash',
......@@ -282,10 +251,6 @@ class TaskController extends Controller {
}, { orderId, taskId });
await service.washData.wash(result, orderId);
await service.washData.newWash(result, orderId);
// await service.cache.set({
// key: String(taskId),
// value: taskNote,
// });
ctx.success({ errcode: 2, data: { state: 0, result: '发送数据处理' } });
} catch (err) {
ctx.logger.error('handleCallback 0', JSON.stringify(err), JSON.stringify(result));
......@@ -294,10 +259,6 @@ class TaskController extends Controller {
note: '运营商认证分析失败',
}, { orderId, taskId });
ctx.success({ errcode: 1, data: { state: -1, result: '运营商认证分析失败' } });
// taskNote = {
// status: 'failure',
// note: { message: err.message },
// };
}
break;
default:
......
......@@ -1012,7 +1012,8 @@ $(function() {
constant.script_root + 'submit',
{ ...params, orderId: constant.orderNum },
function(response) {
if (response.errcode == 0) {
console.log('【submit】', JSON.stringify(response))
if (response.errcode === 0) {
const taskId = response.data.task_id;
if (!!window.WebSocket && window.WebSocket.prototype.send) {
const wsParams = {
......@@ -1024,9 +1025,9 @@ $(function() {
} else {
const params = { taskId: response.data.task_id, orderId: constant.orderNum, phone: constant.phone, redirectUrl: constant.redirectUrl, appkey: constant.appkey };
listen_job_v2(params, function(state, result) {
if (state == 2 || state == 3) {
if (state === 2 || state === 3) {
fn();
} else if (state == 1) {
} else if (state === 1) {
constant.hasclick = true;
if (step == 1) {
title = '成功登录,请获取二次验证码';
......@@ -1104,12 +1105,10 @@ $(function() {
}
});
}
} else {
setTimeout(function() {
failed();
$.prompt(response.errmsg);
$.prompt(response.data.result);
}, 250);
}
},
......
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