Authored by 周少峰

Merge branch 'hotfix/pz'

... ... @@ -55,7 +55,7 @@ const getCoupons = (req, res, next) => {
*/
const setShoppingCookie = (req, res) => {
let uid = req.user.uid || true;
let uid = req.user.uid;
let shoppingKey = helper.getShoppingKeyByCookie(req);
return service.getCartCount(uid, shoppingKey).then(ret => {
... ...
... ... @@ -29,6 +29,8 @@ module.exports = (limiter, policy) => {
const key = `pc:limiter:${limiter.remoteIp}`;
let isNew = false;
res.on('render', function() {
let route = req.route ? req.route.path : '';
let appPath = req.app.mountpath;
... ... @@ -44,7 +46,7 @@ module.exports = (limiter, policy) => {
pageIncr = 5;
}
if (pageIncr > 0) {
if (pageIncr > 0 && !isNew) {
cache.incrAsync(key, pageIncr);
}
});
... ... @@ -70,6 +72,7 @@ module.exports = (limiter, policy) => {
}
} else {
cache.setAsync(key, 1, 60); // 设置key,1m失效
isNew = true;
return Promise.resolve(true);
}
});
... ...
{
"name": "yohobuy-node",
"version": "5.4.12",
"version": "5.4.13",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -772,7 +772,7 @@ $('#order-submit').click(function() {
window._fxcmd.push(['trackOrder', {
oid: rdata.order_code,
otp: rdata.order_amount,
u_info: window.getUser(),
u_info: window.getUid(),
u_type: newUser
}, []]);
window.setCookie('__NEW_USER', 0);
... ...