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
6e04aa48
Commit
6e04aa48
authored
Dec 12, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
16167a82
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
11 deletions
+68
-11
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
+66
-8
igirl-channel-jdweb/app/config/routes/web.js
+2
-3
No files found.
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
View file @
6e04aa48
...
...
@@ -181,6 +181,33 @@ class tmqueryCtl extends CtlBase {
var
resultTmpSign
=
md5
(
resultSignStr
).
toUpperCase
();
return
system
.
getResultSuccess
(
resultTmpSign
);
}
async
getUserIdEncryptStr
(
pobj
,
qobj
,
req
)
{
try
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//有返回用户信息进行用户ID加密
var
param
=
{
actionProcess
:
pobj
.
actionProcess
,
actionType
:
"encryptStr"
,
actionBody
:
{
channelUserId
:
pobj
.
channelUserId
,
opStr
:
pobj
.
channelUserId
},
isUser
:
"yes"
};
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmTools/springBoard"
;
var
resultUser
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
if
(
!
resultUser
)
{
return
system
.
getResult
(
null
,
"req encrypt userId is error"
);
}
if
(
resultUser
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"encrypt userId is error"
);
}
return
resultUser
;
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"操作error..................."
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
async
getUserInfoTest
(
pobj
,
qobj
,
req
)
{
try
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
...
...
@@ -211,6 +238,17 @@ class tmqueryCtl extends CtlBase {
this
.
logClient
.
info
(
"jd"
,
"getUserInfo----->req参数:"
+
JSON
.
stringify
(
pobj
));
if
(
req
.
session
.
userPinInfo
)
{
this
.
logClient
.
info
(
"jd"
,
"req.session.userPinInfo true 参数:"
+
JSON
.
stringify
(
req
.
session
.
userPinInfo
));
if
(
!
req
.
session
.
userPinInfo
.
encryptChannelUserId
)
{
pobj
.
channelUserId
=
req
.
session
.
userPinInfo
.
channelUserId
;
var
userIdEncryptStrResult
=
await
this
.
getUserIdEncryptStr
(
pobj
);
this
.
logClient
.
info
(
"jd"
,
"req.session.userPinInfo userIdEncryptStrResult 结果1111111:"
+
JSON
.
stringify
(
userIdEncryptStrResult
));
if
(
userIdEncryptStrResult
&&
userIdEncryptStrResult
.
status
==
0
)
{
req
.
session
.
userPinInfo
.
encryptChannelUserId
=
userIdEncryptStrResult
.
data
;
}
//重新加密成功
else
{
return
userIdEncryptStrResult
;
}
}
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
});
}
...
...
@@ -251,13 +289,33 @@ class tmqueryCtl extends CtlBase {
return
system
.
getResult
(
null
,
"处理请求失败"
);
}
req
.
session
.
userPinInfo
=
resultUser
.
data
;
if
(
!
req
.
session
.
userPinInfo
.
encryptChannelUserId
)
{
pobj
.
channelUserId
=
req
.
session
.
userPinInfo
.
channelUserId
;
var
userIdEncryptStrResult
=
await
this
.
getUserIdEncryptStr
(
pobj
);
this
.
logClient
.
info
(
"jd"
,
"req.session.userPinInfo userIdEncryptStrResult 结果222222:"
+
JSON
.
stringify
(
userIdEncryptStrResult
));
if
(
userIdEncryptStrResult
&&
userIdEncryptStrResult
.
status
==
0
)
{
req
.
session
.
userPinInfo
.
encryptChannelUserId
=
userIdEncryptStrResult
.
data
;
}
//重新加密成功
else
{
return
userIdEncryptStrResult
;
}
}
return
resultUser
;
}
catch
(
error
)
{
this
.
logClient
.
error
(
"jd"
,
"req---->getUserInfo---->error:"
+
error
.
stack
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
async
opPayPageInfo
(
pobj
,
orderResult
,
req
)
{
var
reqobj
=
{
"actionProcess"
:
pobj
.
actionProcess
||
""
,
"actionType"
:
pobj
.
actionType
||
""
,
"sign"
:
pobj
.
sign
||
""
,
"isUser"
:
pobj
.
isUser
||
"yes"
,
//是否需要验证用户,no否,yes是
"isDecryptUser"
:
pobj
.
isDecryptUser
||
"no"
,
//是否解密用户Id,no否,yes是
"actionBody"
:
pobj
.
actionBody
||
null
};
async
opPayPageInfo
(
pobj
,
orderResult
,
req
)
{
if
(
!
pobj
.
actionBody
.
itemCode
)
{
return
system
.
getResult
(
null
,
"itemCode param is not empty"
);
}
...
...
@@ -285,8 +343,8 @@ class tmqueryCtl extends CtlBase {
return
system
.
getResult
(
null
,
"pay page is error"
);
}
return
system
.
getResultSuccess
();
}
async
putPayOrderData
(
pobj
,
orderResult
,
payDataResult
,
req
)
{
}
async
putPayOrderData
(
pobj
,
orderResult
,
payDataResult
,
req
)
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
...
...
@@ -307,8 +365,8 @@ class tmqueryCtl extends CtlBase {
var
reqUrl
=
this
.
channelApiUrl
+
"/action/tmOrder/springBoard"
;
var
tmp
=
await
this
.
execClient
.
execPostTK
(
param
,
reqUrl
,
tokenInfo
.
data
.
token
);
console
.
log
(
tmp
,
"putPayOrderData########################################333333..........tmptmptmptmp................."
);
}
async
getPayPageAddr
(
itemCode
,
itemCodeList
,
req
)
{
}
async
getPayPageAddr
(
itemCode
,
itemCodeList
,
req
)
{
try
{
const
{
Signer
,
Context
}
=
require
(
'../jd-gateway-sdk'
);
...
...
@@ -417,8 +475,8 @@ class tmqueryCtl extends CtlBase {
console
.
log
(
errorMsg
,
"--jd>>>>>>>errorMsg..............................>>>>>>"
);
return
{
success
:
false
,
code
:
-
200
,
msg
:
errorMsg
.
stack
};
}
}
async
pushPayOrder
(
pushData
,
req
)
{
//处理京东推送的订单信息
}
async
pushPayOrder
(
pushData
,
req
)
{
//处理京东推送的订单信息
try
{
var
signResult
=
await
this
.
createSign
(
pushData
,
"6B876EB84731E166D76E1F73AD5764BA"
,
true
);
if
(
signResult
.
status
!=
0
)
{
...
...
@@ -471,7 +529,7 @@ class tmqueryCtl extends CtlBase {
console
.
log
(
error
.
stack
,
"操作error..................."
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
}
}
module
.
exports
=
tmqueryCtl
;
igirl-channel-jdweb/app/config/routes/web.js
View file @
6e04aa48
...
...
@@ -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,8 +32,7 @@ module.exports = function (app) {
var
skipUrl
=
"/#/jd/"
+
params
.
state
+
"?channelUserId="
+
encodeURIComponent
(
userItemResult
.
data
.
encryptChannelUserId
);
res
.
redirect
(
skipUrl
);
}
catch
(
error
)
{
console
.
log
(
"req---->/jdtm/getUser---->error:"
+
error
.
stack
);
// logClient.error("jd", "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