Commit bba46df7 by 宋毅

tj

parent e28db10e
...@@ -188,8 +188,17 @@ class tmqueryCtl extends CtlBase { ...@@ -188,8 +188,17 @@ class tmqueryCtl extends CtlBase {
async getUserIdEncryptStr(pobj, qobj, req) { async getUserIdEncryptStr(pobj, qobj, req) {
try { try {
if (!req.session.userPinInfo) { if (!req.session.userPinInfo) {
var userInfo = await this.createUserInfo(pobj, qobj, req);
if (userInfo.status != 0) {
return system.getResult(null, "user is not login..."); return system.getResult(null, "user is not login...");
} }
if (req.session.userPinInfo.encryptChannelUserId) {
return system.getResultSuccess({ encryptChannelUserId: req.session.userPinInfo.encryptChannelUserId });
}
}
if (req.session.userPinInfo.encryptChannelUserId) {
return system.getResultSuccess({ encryptChannelUserId: req.session.userPinInfo.encryptChannelUserId });
}
var tokenInfo = await this.getToken(pobj.actionProcess); var tokenInfo = await this.getToken(pobj.actionProcess);
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
return tokenInfo; return tokenInfo;
...@@ -216,7 +225,7 @@ class tmqueryCtl extends CtlBase { ...@@ -216,7 +225,7 @@ class tmqueryCtl extends CtlBase {
return system.getResultFail(-200, "操作error"); return system.getResultFail(-200, "操作error");
} }
} }
async getUserInfoTest(pobj, qobj, req) { async createUserInfo(pobj, qobj, req) {
try { try {
var tokenInfo = await this.getToken(pobj.actionProcess); var tokenInfo = await this.getToken(pobj.actionProcess);
if (tokenInfo.status != 0) { if (tokenInfo.status != 0) {
...@@ -226,7 +235,7 @@ class tmqueryCtl extends CtlBase { ...@@ -226,7 +235,7 @@ class tmqueryCtl extends CtlBase {
var param = { var param = {
actionProcess: pobj.actionProcess, actionProcess: pobj.actionProcess,
actionType: "createChannelUser", actionType: "createChannelUser",
actionBody: { channelUserId: pobj.tmpchannelUserId }, actionBody: { channelUserId: pobj.channelUserId },
isUser: "yes" isUser: "yes"
}; };
var reqUrl = this.channelApiUrl + "/action/tmTools/springBoard"; var reqUrl = this.channelApiUrl + "/action/tmTools/springBoard";
......
...@@ -64,11 +64,27 @@ module.exports = function (app) { ...@@ -64,11 +64,27 @@ module.exports = function (app) {
res.end(JSON.stringify(result)); res.end(JSON.stringify(result));
return; return;
} }
var getUserparams = {
actionProcess: "jd",
channelUserId: req.query.jdPin
};
var userItemResult = await tmqueryCtl.getUserIdEncryptStr(getUserparams, req.query, req);
if (userItemResult.status != 0) {
logClient.payLog("jd", {
optitle: "###操作订单结果...orderNotify...加密用户错误",
op: "/jd/orderNotify",
content: "result=" + JSON.stringify(result),
clientIp: ""
});
res.redirect("/#/jd/jdtrademark");
return;
}
var params = var params =
{ {
instanceId: req.query.orderBizId, instanceId: req.query.orderBizId,
appInfo: { appInfo: {
authUrl: "http://oauth2.jdcloud.com/authorize?response_type=token&redirect_uri=http://tm.plus.jdcloud.com/jdtm/getUser&state=jdindentlist&client_id=9841572588670903" // authUrl: "http://oauth2.jdcloud.com/authorize?response_type=token&redirect_uri=http://tm.plus.jdcloud.com/jdtm/getUser&state=jdindentlist&client_id=9841572588670903"
authUrl: "http://tm.plus.jdcloud.com/#/jd/jdindentlist?channelUserId=" + encodeURIComponent(userItemResult.data.encryptChannelUserId)
} }
}; };
res.end(JSON.stringify(params)); res.end(JSON.stringify(params));
...@@ -85,9 +101,9 @@ module.exports = function (app) { ...@@ -85,9 +101,9 @@ module.exports = function (app) {
actionProcess: "jd", actionProcess: "jd",
authUrl: "https://oauth2.jdcloud.com/userinfo", authUrl: "https://oauth2.jdcloud.com/userinfo",
authToken: params.token_type + " " + params.access_token, authToken: params.token_type + " " + params.access_token,
tmpchannelUserId: params.tmpchannelUserId channelUserId: params.tmpchannelUserId
}; };
var userItemResult = await tmqueryCtl.getUserInfoTest(getUserparams, req.query, req); var userItemResult = await tmqueryCtl.createUserInfo(getUserparams, req.query, req);
if (userItemResult.status != 0) { if (userItemResult.status != 0) {
res.redirect("/#/jd/jdtrademark"); res.redirect("/#/jd/jdtrademark");
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment