coupon no cache, guang delete cache
Showing
2 changed files
with
8 additions
and
2 deletions
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | */ | 5 | */ |
6 | 6 | ||
7 | 'use strict'; | 7 | 'use strict'; |
8 | - | 8 | +const _ = require('lodash'); |
9 | const couponModel = require('../models/coupon'); | 9 | const couponModel = require('../models/coupon'); |
10 | 10 | ||
11 | exports.index = (req, res, next) => { | 11 | exports.index = (req, res, next) => { |
@@ -15,6 +15,12 @@ exports.index = (req, res, next) => { | @@ -15,6 +15,12 @@ exports.index = (req, res, next) => { | ||
15 | uid: req.user.uid, | 15 | uid: req.user.uid, |
16 | contentCode: req.query.contentCode | 16 | contentCode: req.query.contentCode |
17 | }).then(result => { | 17 | }).then(result => { |
18 | + | ||
19 | + // 无结果不缓存 | ||
20 | + if (_.isEmpty(result.categories)) { | ||
21 | + res.set('Cache-Control', 'no-cache'); | ||
22 | + } | ||
23 | + | ||
18 | res.render('coupon', Object.assign({ | 24 | res.render('coupon', Object.assign({ |
19 | module: 'activity', | 25 | module: 'activity', |
20 | page: 'coupon' | 26 | page: 'coupon' |
@@ -948,7 +948,7 @@ const getDynamicDataByIds = (ids, udid, other) => { | @@ -948,7 +948,7 @@ const getDynamicDataByIds = (ids, udid, other) => { | ||
948 | }); | 948 | }); |
949 | } | 949 | } |
950 | 950 | ||
951 | - return serviceApi.get('guang/api/*/article/getSimpleArticleList', params, {cache: true}); | 951 | + return serviceApi.get('guang/api/*/article/getSimpleArticleList', params); |
952 | }; | 952 | }; |
953 | 953 | ||
954 | module.exports = { | 954 | module.exports = { |
-
Please register or login to post a comment