Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
ca7dd328
Commit
ca7dd328
authored
Nov 16, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lin pannogn
parent
624b2fe2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
1 deletions
+55
-1
taskexecutor/app/base/db/task/verif/pannong.js
+34
-0
taskexecutor/app/base/utils/restClient.js
+14
-1
taskexecutor/app/config/settings.js
+7
-0
No files found.
taskexecutor/app/base/db/task/verif/pannong.js
0 → 100644
View file @
ca7dd328
const
TaskBase
=
require
(
"../../task.base"
);
const
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
class
Taskalitmupdate
extends
TaskBase
{
constructor
()
{
super
(
TaskBase
.
getServiceName
(
Taskalitmupdate
));
this
.
restclient
=
system
.
getObject
(
"util.restClient"
);
this
.
gsbDeliverlUrl
=
settings
.
gsbDeliver
();
}
async
beforeTask
(
params
)
{
console
.
log
(
"前置操作......"
,
this
.
serviceName
);
//this.isThrough=true;
//console.log(this.cacheManager);
}
async
subDoTask
()
{
var
obj
=
{}
try
{
if
(
!
this
.
gsbDeliverlUrl
)
{
console
.
log
(
"web/auth/authCtl/refreshToken gsbDeliverlUrl is empty"
)
return
;
}
var
url
=
this
.
gsbDeliverlUrl
+
"web/auth/authCtl/refreshToken"
;
// 2020 1112 lin 新增 这里写死的字符串是由兴业提供 作为请求校验用
var
rtn
=
await
this
.
restclient
.
execPostpannong
(
obj
,
url
,
"5ae2da88-0ced-4b7a-98ea-60d5e1ff7e2e"
);
console
.
log
(
"web/auth/authCtl/refreshToken"
,
rtn
);
return
rtn
;
}
catch
(
error
)
{
console
.
log
(
"error"
,
error
);
return
null
;
}
}
}
module
.
exports
=
Taskalitmupdate
;
\ No newline at end of file
taskexecutor/app/base/utils/restClient.js
View file @
ca7dd328
...
...
@@ -9,7 +9,7 @@ class RestClient{
this
.
cmdPostPattern
=
"curl -k -H 'Content-type: application/json' -d '{data}' '{url}'"
;
this
.
cmdPostPatternMMC
=
"curl -k -H 'Content-type: application/json' -H 'xappkey:f6b59b74-f943-4735-bb86-e05d6b7fdwsv' -d '{data}' '{url}'"
;
this
.
cmdPostPatternWithAK
=
"curl -k -H 'Content-type: application/json' -H 'AccessKey:{ak}' -d '{data}' {url} -m 20000"
;
this
.
cmdDataPostByTokenPattern
=
"curl -k -H 'Content-type: application/json' -H 'xappkey:{xappkey}' -d '{data}' {url}"
;
this
.
cmdDownLoadFilePattern
=
"curl -G -o {fileName} {url}"
;
this
.
cmdPostPattern2
=
"curl -k -H 'Content-type: application/x-www-form-urlencoded' -d '{data}' {url}"
;
...
...
@@ -29,6 +29,12 @@ class RestClient{
return
cmd
;
}
FetchPostCmdpannong
(
subData
,
url
,
xappkey
)
{
var
data
=
JSON
.
stringify
(
subData
);
var
cmd
=
this
.
cmdDataPostByTokenPattern
.
replace
(
/
\{
data
\}
/g
,
data
).
replace
(
/
\{
xappkey
\}
/g
,
xappkey
).
replace
(
/
\{
url
\}
/g
,
url
);
return
cmd
;
}
FetchPostCmdMMC
(
subData
,
url
)
{
var
data
=
JSON
.
stringify
(
subData
);
var
cmd
=
this
.
cmdPostPatternMMC
.
replace
(
/
\{
data
\}
/g
,
...
...
@@ -109,6 +115,13 @@ class RestClient{
});
return
result
;
}
async
execPostpannong
(
subData
,
url
,
xappkey
){
let
cmd
=
this
.
FetchPostCmdpannong
(
subData
,
url
,
xappkey
);
var
result
=
await
this
.
exec
(
cmd
,{
maxBuffer
:
10000
*
1024
});
return
result
;
}
async
execPostMMC
(
subData
,
url
){
let
cmd
=
this
.
FetchPostCmdMMC
(
subData
,
url
);
var
result
=
await
this
.
exec
(
cmd
,{
...
...
taskexecutor/app/config/settings.js
View file @
ca7dd328
...
...
@@ -50,6 +50,13 @@ var settings = {
return
"http://center-channel-service.chaolai/"
;
}
},
gsbDeliver
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://icpdeliver-service.newtime/"
;
// 2020 1116 lin 新增 本地测试用(测试环境没定时任务)
}
else
{
return
"http://icpdeliver-service.newtime/"
;
}
},
fqbossUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.0.106:4012/"
;
...
...
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