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
d7563092
Commit
d7563092
authored
Dec 12, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
16972ca1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
9 deletions
+12
-9
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
+1
-0
igirl-channel-jdweb/app/base/utils/execClient.js
+6
-5
igirl-channel-jdweb/app/config/log4js.json
+2
-2
igirl-channel-jdweb/app/config/routes/web.js
+3
-2
No files found.
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
View file @
d7563092
...
...
@@ -212,6 +212,7 @@ class tmqueryCtl extends CtlBase {
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
});
}
this
.
logClient
.
info
(
"jd"
,
"getUserInfo----->req参数:"
+
JSON
.
stringify
(
pobj
));
// console.log();
var
authUrl
=
pobj
.
authUrl
;
var
authToken
=
pobj
.
authToken
;
var
actionProcess
=
pobj
.
actionProcess
;
...
...
igirl-channel-jdweb/app/base/utils/execClient.js
View file @
d7563092
...
...
@@ -2,7 +2,7 @@ var childproc = require('child_process');
const
util
=
require
(
'util'
);
const
exec
=
util
.
promisify
(
require
(
'child_process'
).
exec
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
system
=
require
(
"../system"
);
//
const system = require("../system");
class
ExecClient
{
constructor
()
{
this
.
cmdPostPattern
=
"curl -k -H 'Content-type: application/json' -d '{data}' {url}"
;
...
...
@@ -10,7 +10,7 @@ class ExecClient {
this
.
cmdPostTK
=
"curl -k -H 'Content-type: application/json' -H 'token:{tk}' -H 'request-id:{requestId}' -d '{data}' {url}"
;
this
.
cmdJDPostTK
=
"curl -k -H 'Content-type:text/plain;charset=UTF-8' -H 'metadata:true' -H 'Authorization:{tk}' -d '{data}' {url}"
;
this
.
logClient
=
system
.
getObject
(
"util.logClient"
);
//
this.logClient = system.getObject("util.logClient");
}
getUUID
()
{
var
uuid
=
uuidv4
();
...
...
@@ -22,7 +22,8 @@ class ExecClient {
var
result
=
await
this
.
exec
(
cmd
,
{
maxBuffer
:
1024
*
1024
*
15
});
this
.
logClient
.
info
(
"jd"
,
"getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->result:"
+
result
.
stdout
);
console
.
log
(
"getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->result:"
+
result
.
stdout
);
// this.logClient.info("jd", "getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->result:" + result.stdout);
var
rtn
=
result
.
stdout
;
if
(
rtn
)
{
return
JSON
.
parse
(
rtn
);
...
...
@@ -35,8 +36,8 @@ class ExecClient {
var
requestId
=
this
.
getUUID
();
var
cmd
=
this
.
cmdJDPostTK
.
replace
(
/
\{
data
\}
/g
,
data
).
replace
(
/
\{
url
\}
/g
,
url
).
replace
(
/
\{
tk
\}
/g
,
token
);
console
.
log
(
cmd
);
this
.
logClient
.
info
(
"jd"
,
"getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->"
+
cmd
);
console
.
log
(
"getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->"
+
cmd
);
//
this.logClient.info("jd", "getUserInfo----->execPostJDTK----FetchPostJDTK----cmd--->" + cmd);
return
cmd
;
}
async
execPostTK
(
subData
,
url
,
token
)
{
...
...
igirl-channel-jdweb/app/config/log4js.json
View file @
d7563092
...
...
@@ -10,7 +10,7 @@
"type"
:
"file"
,
"filename"
:
"logs/infoFile/info"
,
"encoding"
:
"utf-8"
,
"maxLogSize"
:
10000
,
"maxLogSize"
:
10000
00
,
"backups"
:
5
,
"pattern"
:
"-yyyy-MM-dd-hh.log"
,
"category"
:
"info_file"
...
...
@@ -19,7 +19,7 @@
"type"
:
"file"
,
"filename"
:
"logs/errorFile/error"
,
"encoding"
:
"utf-8"
,
"maxLogSize"
:
10000
,
"maxLogSize"
:
10000
00
,
"backups"
:
5
,
"pattern"
:
"-yyyy-MM-dd-hh.log"
,
"category"
:
"error_file"
...
...
igirl-channel-jdweb/app/config/routes/web.js
View file @
d7563092
...
...
@@ -2,7 +2,7 @@
var
system
=
require
(
"../../base/system"
);
var
metaCtl
=
system
.
getObject
(
"web.common.metaCtl"
);
var
tmqueryCtl
=
system
.
getObject
(
"web.trademark.tmqueryCtl"
);
var
logClient
=
system
.
getObject
(
"util.logClient"
);
//
var logClient = system.getObject("util.logClient");
module
.
exports
=
function
(
app
)
{
app
.
get
(
"/jdtm/getUser"
,
async
function
(
req
,
res
)
{
try
{
...
...
@@ -32,7 +32,8 @@ module.exports = function (app) {
var
skipUrl
=
"/#/jd/"
+
params
.
state
+
"?channelUserId="
+
encodeURIComponent
(
userItemResult
.
data
.
encryptChannelUserId
);
res
.
redirect
(
skipUrl
);
}
catch
(
error
)
{
this
.
logClient
.
error
(
"jd"
,
"req---->/jdtm/getUser---->error:"
+
error
.
stack
);
console
.
log
(
"req---->/jdtm/getUser---->error:"
+
error
.
stack
);
// logClient.error("jd", "req---->/jdtm/getUser---->error:" + error.stack);
}
});
app
.
get
(
"/jdtm/getUserTest"
,
async
function
(
req
,
res
)
{
...
...
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