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
8e7a3ac8
Commit
8e7a3ac8
authored
Dec 10, 2019
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
80848f10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
39 deletions
+63
-39
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
+42
-39
igirl-channel-jdweb/app/config/routes/web.js
+21
-0
No files found.
igirl-channel-jdweb/app/base/controller/impl/trademark/tmqueryCtl.js
View file @
8e7a3ac8
...
...
@@ -179,8 +179,7 @@ class tmqueryCtl extends CtlBase {
var
resultTmpSign
=
md5
(
resultSignStr
).
toUpperCase
();
return
system
.
getResultSuccess
(
resultTmpSign
);
}
async
getUserInfo
(
pobj
,
qobj
,
req
)
{
async
getUserInfoTest
(
pobj
,
qobj
,
req
)
{
try
{
var
tokenInfo
=
await
this
.
getToken
(
pobj
.
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
...
...
@@ -200,43 +199,47 @@ class tmqueryCtl extends CtlBase {
}
req
.
session
.
userPinInfo
=
resultUser
.
data
;
return
resultUser
;
// var authUrl = pobj.authUrl;
// var authToken = pobj.authToken;
// var actionProcess = pobj.actionProcess;
// if (!authUrl) {
// return system.getResult(null, "authUrl不能为空");
// }
// if (!authToken) {
// return system.getResult(null, "authToken不能为空");
// }
// if (!actionProcess) {
// return system.getResult(null, "actionProcess不能为空");
// }
// var result = await this.execClient.execPostJDTK("", authUrl, authToken);
// if (!result || !result.account) {
// return system.getResult(null, "处理用户请求失败,msg:" + result.error_description);
// }
// var tokenInfo = await this.getToken(actionProcess);
// if (tokenInfo.status != 0) {
// return tokenInfo;
// }
// //有返回用户信息进行用户ID加密
// var param = {
// actionProcess: actionProcess,
// actionType: "createChannelUser",
// actionBody: { channelUserId: result.account },
// 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.session.userPinInfo = resultUser.data;
// return resultUser;
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"操作error..................."
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
}
}
async
getUserInfo
(
pobj
,
qobj
,
req
)
{
try
{
var
authUrl
=
pobj
.
authUrl
;
var
authToken
=
pobj
.
authToken
;
var
actionProcess
=
pobj
.
actionProcess
;
if
(
!
authUrl
)
{
return
system
.
getResult
(
null
,
"authUrl不能为空"
);
}
if
(
!
authToken
)
{
return
system
.
getResult
(
null
,
"authToken不能为空"
);
}
if
(
!
actionProcess
)
{
return
system
.
getResult
(
null
,
"actionProcess不能为空"
);
}
var
result
=
await
this
.
execClient
.
execPostJDTK
(
""
,
authUrl
,
authToken
);
if
(
!
result
||
!
result
.
account
)
{
return
system
.
getResult
(
null
,
"处理用户请求失败,msg:"
+
result
.
error_description
);
}
var
tokenInfo
=
await
this
.
getToken
(
actionProcess
);
if
(
tokenInfo
.
status
!=
0
)
{
return
tokenInfo
;
}
//有返回用户信息进行用户ID加密
var
param
=
{
actionProcess
:
actionProcess
,
actionType
:
"createChannelUser"
,
actionBody
:
{
channelUserId
:
result
.
account
},
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
.
session
.
userPinInfo
=
resultUser
.
data
;
return
resultUser
;
}
catch
(
error
)
{
console
.
log
(
error
.
stack
,
"操作error..................."
);
return
system
.
getResultFail
(
-
200
,
"操作error"
);
...
...
igirl-channel-jdweb/app/config/routes/web.js
View file @
8e7a3ac8
...
...
@@ -24,6 +24,27 @@ module.exports = function (app) {
var
skipUrl
=
"/#/jd/"
+
params
.
state
+
"?channelUserId="
+
encodeURIComponent
(
userItemResult
.
data
.
encryptChannelUserId
);
res
.
redirect
(
skipUrl
);
});
app
.
get
(
"/jdtm/getUserTest"
,
async
function
(
req
,
res
)
{
console
.
log
(
req
.
query
,
"/jdtm/getUser...................."
);
var
params
=
req
.
query
;
if
(
!
params
.
state
)
{
res
.
redirect
(
"/#/jd/jdtrademark"
);
return
;
}
var
getUserparams
=
{
actionProcess
:
"jd"
,
authUrl
:
"https://oauth2.jdcloud.com/userinfo"
,
authToken
:
params
.
token_type
+
" "
+
params
.
access_token
,
tmpchannelUserId
:
params
.
tmpchannelUserId
};
var
userItemResult
=
await
tmqueryCtl
.
getUserInfoTest
(
getUserparams
,
req
.
query
,
req
);
if
(
userItemResult
.
status
!=
0
)
{
res
.
redirect
(
"/#/jd/jdtrademark"
);
return
;
}
var
skipUrl
=
"/#/jd/"
+
params
.
state
+
"?channelUserId="
+
encodeURIComponent
(
userItemResult
.
data
.
encryptChannelUserId
);
res
.
redirect
(
skipUrl
);
});
app
.
get
(
"/jd/orderNotify"
,
async
function
(
req
,
res
)
{
// oplogCtl.info({
// optitle: "########################################################.................orderNotify",
...
...
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