Authored by 郭成尧

paycenter-router-redirect

@@ -55,4 +55,7 @@ router.get('/index/new/advanceBuy', indexController.advanceBuy); // 获取购物 @@ -55,4 +55,7 @@ router.get('/index/new/advanceBuy', indexController.advanceBuy); // 获取购物
55 router.post('/index/new/giftinfo', indexController.giftinfo); // 获取购物车加价购商品数据,chosepanel 55 router.post('/index/new/giftinfo', indexController.giftinfo); // 获取购物车加价购商品数据,chosepanel
56 56
57 57
  58 +// 支付中心 URL,由于微信安全限制,在现有 URL 后追加 new ,通过 subDomain 中间件转发到此
  59 +router.get('/home/orders/paynew', authMW, payController.payCenter);
  60 +
58 module.exports = router; 61 module.exports = router;
@@ -29,8 +29,6 @@ const suggest = require(`${cRoot}/suggest`); @@ -29,8 +29,6 @@ const suggest = require(`${cRoot}/suggest`);
29 const message = require(`${cRoot}/message`); 29 const message = require(`${cRoot}/message`);
30 const onlineService = require(`${cRoot}/onlineService`); 30 const onlineService = require(`${cRoot}/onlineService`);
31 31
32 -const payController = require('../cart/controllers/pay');  
33 -  
34 // const myDetail = require(`${cRoot}/myDetail); 32 // const myDetail = require(`${cRoot}/myDetail);
35 33
36 34
@@ -134,7 +132,4 @@ router.get('/installment/card-detail', installment.cardDetail); // 银行å¡è¯¦æ @@ -134,7 +132,4 @@ router.get('/installment/card-detail', installment.cardDetail); // 银行å¡è¯¦æ
134 router.get('/installment/delBankCard', installment.delBankCard); // 删除绑定 132 router.get('/installment/delBankCard', installment.delBankCard); // 删除绑定
135 router.get('/installment/setMasterCard', installment.setMasterCard); // 切换主卡 133 router.get('/installment/setMasterCard', installment.setMasterCard); // 切换主卡
136 134
137 -// 支付中心 URL,由于微信安全限制,在现有 URL 后追加 new  
138 -router.get('/orders/paynew', auth, payController.payCenter);  
139 -  
140 module.exports = router; 135 module.exports = router;
@@ -11,6 +11,11 @@ const helpers = global.yoho.helpers; @@ -11,6 +11,11 @@ const helpers = global.yoho.helpers;
11 11
12 module.exports = () => { 12 module.exports = () => {
13 return (req, res, next) => { 13 return (req, res, next) => {
  14 + if (/^\/home\/orders\/paynew/.test(req.url)) {
  15 + // 支付中心,由于微信安全配置限制在 home/orders 路径下,需要转发,误删!!!
  16 + req.url = `/cart${req.url}`;
  17 + }
  18 +
14 if (/^\/coupon\/floor/.test(req.url)) { 19 if (/^\/coupon\/floor/.test(req.url)) {
15 // 领券中心 兼容php的url 20 // 领券中心 兼容php的url
16 req.url = `/activity${req.url}`; 21 req.url = `/activity${req.url}`;