最近十笔订单和全球购订单接口session_key添加
Showing
3 changed files
with
18 additions
and
7 deletions
@@ -98,9 +98,10 @@ exports.saveMSG = (req, res) => { | @@ -98,9 +98,10 @@ exports.saveMSG = (req, res) => { | ||
98 | * 2. 失败情况 | 98 | * 2. 失败情况 |
99 | */ | 99 | */ |
100 | exports.fetchOrders = (req, res) => { | 100 | exports.fetchOrders = (req, res) => { |
101 | - let encryptedUid = req.body.encryptedUid; | 101 | + const uid = req.user.uid || req.query.uid; |
102 | + const encryptedUid = req.body.encryptedUid; | ||
102 | 103 | ||
103 | - imApi.fetchOrderList(encryptedUid) | 104 | + imApi.fetchOrderList(uid, encryptedUid) |
104 | .then(result => { | 105 | .then(result => { |
105 | imModel.handleOrderList(result.data, 128, 170); | 106 | imModel.handleOrderList(result.data, 128, 170); |
106 | res.json(result); | 107 | res.json(result); |
@@ -142,7 +143,8 @@ exports.saveEvalute = (req, res) => { | @@ -142,7 +143,8 @@ exports.saveEvalute = (req, res) => { | ||
142 | 143 | ||
143 | 144 | ||
144 | exports.queryGlobalOrder = (req, res) => { | 145 | exports.queryGlobalOrder = (req, res) => { |
145 | - let encryptedUid = req.body.encryptedUid; | 146 | + const uid = req.user.uid || req.query.uid; |
147 | + const encryptedUid = req.body.encryptedUid; | ||
146 | 148 | ||
147 | let emptyOrder = { | 149 | let emptyOrder = { |
148 | code: 200, | 150 | code: 200, |
@@ -150,9 +152,12 @@ exports.queryGlobalOrder = (req, res) => { | @@ -150,9 +152,12 @@ exports.queryGlobalOrder = (req, res) => { | ||
150 | message: '获取失败' | 152 | message: '获取失败' |
151 | }; | 153 | }; |
152 | 154 | ||
153 | - imApi.queryGlobalOrder(encryptedUid) | 155 | + imApi.queryGlobalOrder(uid, encryptedUid) |
154 | .then(result=> { | 156 | .then(result=> { |
155 | - imModel.handleOrderList(result.data, 128, 170); | 157 | + if (result.code === 200) { |
158 | + imModel.handleOrderList(result.data, 128, 170); | ||
159 | + } | ||
160 | + | ||
156 | res.json(result); | 161 | res.json(result); |
157 | }, () => { | 162 | }, () => { |
158 | res.json(emptyOrder); | 163 | res.json(emptyOrder); |
@@ -67,8 +67,9 @@ exports.fetchImHistory = (encryptedUid, endTime, pageSize, startTime) => { | @@ -67,8 +67,9 @@ exports.fetchImHistory = (encryptedUid, endTime, pageSize, startTime) => { | ||
67 | * @param {string} encryptedUid 用户加密uid | 67 | * @param {string} encryptedUid 用户加密uid |
68 | * @param {init} createTimeBegin 开始时间 | 68 | * @param {init} createTimeBegin 开始时间 |
69 | */ | 69 | */ |
70 | -exports.fetchOrderList = (encryptedUid, createTimeBegin) => { | 70 | +exports.fetchOrderList = (uid, encryptedUid, createTimeBegin) => { |
71 | let params = { | 71 | let params = { |
72 | + uid, | ||
72 | encryptedUid, | 73 | encryptedUid, |
73 | imgSize: '90x120', | 74 | imgSize: '90x120', |
74 | }; | 75 | }; |
@@ -111,8 +112,9 @@ exports.saveEvalute = (params) => { | @@ -111,8 +112,9 @@ exports.saveEvalute = (params) => { | ||
111 | * 获取全球购的订单 | 112 | * 获取全球购的订单 |
112 | */ | 113 | */ |
113 | 114 | ||
114 | -exports.queryGlobalOrder = encryptedUid => { | 115 | +exports.queryGlobalOrder = (uid, encryptedUid) => { |
115 | let params = { | 116 | let params = { |
117 | + uid, | ||
116 | encryptedUid | 118 | encryptedUid |
117 | }; | 119 | }; |
118 | 120 |
@@ -370,6 +370,10 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -370,6 +370,10 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, { | ||
370 | if (totalCount === null) { // 还未加载数据 | 370 | if (totalCount === null) { // 还未加载数据 |
371 | api.fetchOrders(type).done( | 371 | api.fetchOrders(type).done( |
372 | result => { | 372 | result => { |
373 | + if (result && result.code === 401) { | ||
374 | + window.location.href = '//m.yohobuy.com/signin.html?refer=' + window.location.href; | ||
375 | + } | ||
376 | + | ||
373 | let html = self.orderListT({ | 377 | let html = self.orderListT({ |
374 | orders: result.data, | 378 | orders: result.data, |
375 | isApp: appBridge.isApp, | 379 | isApp: appBridge.isApp, |
-
Please register or login to post a comment