Commit e5906174 by 刘泽奇

Merge branch 'igirl-channel-web' of gitlab.gongsibao.com:jiangyong/zhichan into igirl-channel-web

parents edfd39b4 b36c562e
......@@ -292,6 +292,29 @@ class tmqueryCtl extends CtlBase {
});
}
async getOrderDetails(pobj, qobj, req) {
try {
var tokenInfo = await this.getToken(pobj.actionProcess);
if (tokenInfo.status != 0) {
return tokenInfo;
}
var param = {
actionProcess: pobj.actionProcess,
actionType: "getOrderDetails",
actionBody: pobj,
isUser: "yes"
};
var reqUrl = this.channelApiUrl + "/action/tmOrder/springBoard";
var result = await this.execClient.execPostTK(param, reqUrl, tokenInfo.data.token);
if (!result) {
return system.getResult(null, "处理请求失败");
}
return result;
} catch (error) {
console.log(error.stack, "操作error...................getOrderDetails");
return system.getResultFail(-200, "操作error");
}
}
//----------------------------jd------操作------------start
async getJdUserInfo(pobj, qobj, req) {
try {
......
......@@ -179,6 +179,49 @@ module.exports = function (app) {
res.end(JSON.stringify(params));
return;
});
app.get("/gsbhome/orderDetails", async function (req, res) {
var skipUrl = `https://www.gongsibao.com/user.php?redirect=${encodeURIComponent('https://zcchannelweb.gongsibao.com/gsbhome?state=jdindentlist')}`;
var params = req.query;
if (!params.order_no) {
res.redirect(skipUrl);
return;
}
var token = req.cookies.ic_token;
if (!token) {
res.redirect(skipUrl);
return;
}
var userInfo = jwt.verify(token, secret, function (err, decoded) {
if (err) {
return system.getResult(null, "验证token失败");
}
else {
return system.getResultSuccess(decoded);
}
});
if (userInfo.status != 0) {
res.redirect(skipUrl);
return;
}
var reqParams = {
actionProcess: "gsbhome",
channelUserId: userInfo.data.phone + "_" + userInfo.data.id,
channelUserMoblie: userInfo.data.phone,
needNoOrderNo: params.order_no
};
var userItemResult = await tmqueryCtl.getUserIdEncryptStr(reqParams, req.query, req);
if (userItemResult.status != 0) {
res.redirect(skipUrl);
return;
}
var orderItem = await tmqueryCtl.getOrderDetails(reqParams, req.query, req);
if (orderItem.status != 0) {
res.redirect(skipUrl);
return;
}
skipUrl = "/#/gsbhome/jdindentdetail?channelUserId=" + encodeURIComponent(userItemResult.data.encryptChannelUserId) + "&deliveryOrderNo=" + orderItem.data.deliveryOrderNo + "&order_no=" + params.order_no + "&deliveryStatus=" + orderItem.data.deliveryStatus;
res.redirect(skipUrl);
});
app.get("/", async function (req, res) {
try {
var appinfo = await metaCtl.getAppInfo(req);
......
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