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
f23b5faa
Commit
f23b5faa
authored
Dec 14, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
afd5a54f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
29 deletions
+42
-29
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
+6
-29
igirl-channel-jdweb/app/config/routes/web.js
+36
-0
No files found.
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
View file @
f23b5faa
...
...
@@ -129,7 +129,7 @@ class tmqueryCtl extends CtlBase {
reqParam
=
self
.
appInfo
[
"jd"
];
break
;
case
"1688"
:
reqParam
=
self
.
appInfo
[
"
jd
"
];
reqParam
=
self
.
appInfo
[
"
1688
"
];
break
;
default
:
break
;
...
...
@@ -252,7 +252,7 @@ class tmqueryCtl extends CtlBase {
}
async
getJdUserInfo
(
pobj
,
qobj
,
req
)
{
try
{
this
.
logClient
.
error
(
"jd"
,
"getUserInfo--error
--->pobj:"
+
JSON
.
stringify
(
pobj
));
// this.logClient.info("jd", "getUserInfo--info
--->pobj:" + JSON.stringify(pobj));
if
(
req
.
session
.
userPinInfo
)
{
return
system
.
getResultSuccess
({
encryptChannelUserId
:
req
.
session
.
userPinInfo
.
encryptChannelUserId
||
""
});
}
...
...
@@ -313,10 +313,10 @@ class tmqueryCtl extends CtlBase {
// '{"success":true,"code":null,"msg":null,"data":{"orderNumber":"6058867","erpOrderId":"523198741458590844",
// "returnUrl":"https://buy.jdcloud.com/pay?orderId=523198741458590844","saasCheckUrl":null}}' }
console
.
log
(
tmpResult
,
"tmpResult...........opPayPageInfo........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$...."
);
this
.
logClient
.
info
(
"jd"
,
"opPayPageInfo--tmpResult-->"
+
JSON
.
stringify
(
tmpResult
));
if
(
tmpResult
&&
tmpResult
.
result
&&
tmpResult
.
result
==
true
)
{
var
payDataResult
=
JSON
.
parse
(
tmpResult
.
data
);
console
.
log
(
payDataResult
,
"payDataResult...........payDataResult........$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$..002.."
);
if
(
payDataResult
&&
payDataResult
.
success
&&
payDataResult
.
success
==
true
)
{
//更新订单信息
await
this
.
putPayOrderData
(
pobj
,
orderResult
,
payDataResult
,
req
);
...
...
@@ -361,7 +361,6 @@ class tmqueryCtl extends CtlBase {
accessKeyId
:
'C6D680733C19362B5DF478207D6A90A4'
,
//替换自己的AK
secretAccessKey
:
'EB9AFEE49CE41700CADD5F2EE3B2122C'
//替换自己的SK--jd>>>>>>>
}
//测试报文:
//ctx.body = "pin=jcloud_pRiHQTd&serviceId=580010&itemCode=FW_GOODS-580010-1&platform=6"
//POST
...
...
@@ -379,7 +378,6 @@ class tmqueryCtl extends CtlBase {
};
//这是需要提交的数据
// var tmpContent = '{"pin":"syaify","serviceId":"581976","itemCode":"FW_GOODS-581976","platform":6,"orderNum":1,"articleType":1,"additions":{"246":0}}';
var
tmpContent
=
JSON
.
stringify
(
post_data
);
var
tmpContentLength
=
Buffer
.
byteLength
(
tmpContent
);
ctx
.
body
=
tmpContent
;
...
...
@@ -432,31 +430,10 @@ class tmqueryCtl extends CtlBase {
req
.
write
(
tmpContent
);
req
.
end
();
});
var
tmd
=
99
;
return
reqResult
;
// var req = http.request(options, function (res) {
// console.log("statusCode: ", res.statusCode);
// console.log("headers: ", res.headers);
// var _data = '';
// res.on('data', function (chunk) {
// _data += chunk;
// });
// res.on('end', function () {
// console.log("\n--->>\nresult:", _data)
// });
// });
// req.on('error', (e) => {
// console.error(`请求遇到问题-------------: ${e.message}`);
// });
// req.write(tmpContent);
// req.end();
// var tmd = 99;
}
catch
(
errorMsg
)
{
console
.
log
(
errorMsg
,
"--jd>>>>>>>errorMsg..............................>>>>>>"
);
return
{
success
:
false
,
code
:
-
200
,
msg
:
error
Msg
.
stack
};
this
.
logClient
.
error
(
"jd"
,
"req---->getPayPageAddr---->error:"
+
error
.
stack
);
return
{
success
:
false
,
code
:
-
200
,
msg
:
error
.
stack
};
}
}
async
pushPayOrder
(
pushData
,
req
)
{
//处理京东推送的订单信息
...
...
igirl-channel-jdweb/app/config/routes/web.js
View file @
f23b5faa
...
...
@@ -100,6 +100,42 @@ module.exports = function (app) {
res
.
redirect
(
"/#/jd/jdindentlist?channelUserId="
+
encodeURIComponent
(
userItemResult
.
data
.
encryptChannelUserId
));
return
;
});
app
.
get
(
"/1688/selfRegister"
,
async
function
(
req
,
res
)
{
var
params
=
{
actionProcess
:
"1688"
,
requrl
:
"/action/tmOrder/springBoard"
,
actionType
:
"op1688ChannelPushOrder"
,
actionBody
:
req
.
query
};
params
.
actionBody
.
channelItemCode
=
"1406046"
;
var
result
=
await
tmqueryCtl
.
doPost
(
params
,
null
,
req
);
if
(
result
.
status
!=
0
)
{
console
.
log
(
result
,
"result........."
);
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
var
skipUrl
=
"/#/1688/jdindentlist?channelUserId="
+
encodeURIComponent
(
result
.
data
);
res
.
redirect
(
skipUrl
);
});
app
.
get
(
"/1688/auxRegister"
,
async
function
(
req
,
res
)
{
var
params
=
{
actionProcess
:
"1688"
,
requrl
:
"/action/tmOrder/springBoard"
,
actionType
:
"op1688ChannelPushOrder"
,
actionBody
:
req
.
query
};
params
.
actionBody
.
channelItemCode
=
"3492659"
;
var
result
=
await
tmqueryCtl
.
doPost
(
params
,
null
,
req
);
if
(
result
.
status
!=
0
)
{
console
.
log
(
result
,
"result........."
);
res
.
end
(
JSON
.
stringify
(
result
));
return
;
}
var
skipUrl
=
"/#/1688/jdindentlist?channelUserId="
+
encodeURIComponent
(
result
.
data
);
res
.
redirect
(
skipUrl
);
});
app
.
get
(
"/"
,
async
function
(
req
,
res
)
{
try
{
var
appinfo
=
await
metaCtl
.
getAppInfo
(
req
);
...
...
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