Commit 480fa7b2 authored by 何娜's avatar 何娜

调试1

parent 2a9d64aa
Pipeline #28089 failed with stage
in 23 seconds
......@@ -27,6 +27,11 @@ class TaskController extends Controller {
this.taskIdRule = {
taskId: { type: 'string', format: /\d+/ },
};
this.getJobRule = {
orderId: { required: true },
taskId: { required: true },
};
}
async configs() {
......@@ -53,10 +58,6 @@ class TaskController extends Controller {
operator: phoneData.operator || '',
status: 'init',
});
// await service.cache.set({
// key: String(tasks.taskId),
// value: { status: 'init', note: { message: 'init' } },
// });
ctx.success({ task_id: tasks.taskId });
}
......@@ -80,6 +81,13 @@ class TaskController extends Controller {
ctx.success({ errcode: 0, data: { task_id } });
}
async getJob() {
const { ctx, service, config } = this;
ctx.validate(this.getJobRule);
ctx.logger.info('【getJob】')
}
async wslink() {
const { ctx, service } = this;
console.log('【wslink】ctx---', ctx);
......
......@@ -806,7 +806,7 @@ $(function() {
return (new Scheduler({ timeout: 15 * 60 * 1000, duration: 3000 })).begin(function() {
const self = this;
doJsonAjax(
constant.project_root + 'taskId/get_job',
constant.script_root + 'getjob',
params,
function(result) {
result = JSON.parse(result);
......@@ -856,11 +856,12 @@ $(function() {
if ('type' in params) {
queryString += '&type=query';
}
if (window.location.protocol == 'http:') {
url = 'ws://' + window.location.host + '/yysh5/ws/' + queryString;
if (window.location.protocol === 'http:') {
url = 'ws://' + window.location.host + '/yysh5/ws' + queryString;
} else {
url = 'wss://' + window.location.host + '/yysh5/ws/' + queryString;
url = 'wss://' + window.location.host + '/yysh5/ws' + queryString;
}
console.log('【ws】url', url);
const ws = require('socket.io-client')(url);
ws.onclose = function() {
if (ws.status !== 'close') {
......@@ -983,8 +984,6 @@ $(function() {
dialog.model(true);
$('.dialog-button.confirm').attr('disabled', 'disabled');
}
}
......@@ -1012,7 +1011,6 @@ $(function() {
constant.script_root + 'submit',
{ ...params, orderId: constant.orderNum },
function(response) {
console.log('【submit】', JSON.stringify(response))
if (response.errcode === 0) {
const taskId = response.data.task_id;
if (!!window.WebSocket && window.WebSocket.prototype.send) {
......@@ -1029,7 +1027,7 @@ $(function() {
fn();
} else if (state === 1) {
constant.hasclick = true;
if (step == 1) {
if (step === 1) {
title = '成功登录,请获取二次验证码';
} else {
title = '成功登录,请再次获取最新验证码';
......@@ -1108,7 +1106,7 @@ $(function() {
} else {
setTimeout(function() {
failed();
$.prompt(response.data.result);
$.prompt(response.errmsg);
}, 250);
}
},
......
......@@ -15,6 +15,7 @@ module.exports = app => {
yysRouter.get('/tasks/:taskId', controller.task.show); // 获取任务状态
yysRouter.post('/submit', controller.task.submit); // 提交任务参数
yysRouter.post('/capture', controller.task.fetchCapture); // 获取验证码
yysRouter.post('/getjob', controller.task.getJob);
yysRouter.post('/callback', controller.task.handleCallback); // 处理回调结果,不对外
yysRouter.post('/dataCallback', controller.task.dataCallback);// 数据处理完成结果,不对外
......
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