Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yysh5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data_server
yysh5
Commits
480fa7b2
Commit
480fa7b2
authored
Sep 10, 2020
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试1
parent
2a9d64aa
Pipeline
#28089
failed with stage
in 23 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
13 deletions
+20
-13
task.js
app/controller/task.js
+12
-4
query.js
app/public/js/query.js
+7
-9
router.js
app/router.js
+1
-0
No files found.
app/controller/task.js
View file @
480fa7b2
...
...
@@ -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
);
...
...
app/public/js/query.js
View file @
480fa7b2
...
...
@@ -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
+
'get
job'
,
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
);
}
},
...
...
app/router.js
View file @
480fa7b2
...
...
@@ -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
);
// 数据处理完成结果,不对外
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment