Authored by ccbikai(👎🏻🍜)

购物车问题修改

@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 */ 5 */
6 6
7 'use strict'; 7 'use strict';
  8 +const helpers = global.yoho.helpers;
8 9
9 module.exports = () => { 10 module.exports = () => {
10 return (req, res, next) => { 11 return (req, res, next) => {
@@ -31,6 +32,8 @@ module.exports = () => { @@ -31,6 +32,8 @@ module.exports = () => {
31 res.set('Access-Control-Allow-Origin', '*'); 32 res.set('Access-Control-Allow-Origin', '*');
32 } 33 }
33 34
  35 + res.locals.cartUrl = helpers.urlFormat('/cart/index/index');
  36 +
34 next(); 37 next();
35 }; 38 };
36 }; 39 };
1 <div id="suspend-cart" class="suspend-cart"> 1 <div id="suspend-cart" class="suspend-cart">
2 - <a href={{cartUrl}}> 2 + <a href="{{@root.cartUrl}}">
3 <span class="iconfont">&#xe62c;</span> 3 <span class="iconfont">&#xe62c;</span>
4 </a> 4 </a>
5 <span class="cart-count hide">0</span> 5 <span class="cart-count hide">0</span>
6 -</div>  
  6 +</div>