Authored by 郭成尧

usePwa

  1 +const _ = require('lodash');
  2 +
1 module.exports = { 3 module.exports = {
2 index(req, res) { 4 index(req, res) {
3 // 千万别缓存 5 // 千万别缓存
@@ -7,8 +9,10 @@ module.exports = { @@ -7,8 +9,10 @@ module.exports = {
7 Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString() 9 Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString()
8 }); 10 });
9 11
  12 + let closeUserPwa = _.get(req.app.locals.wap, 'close.usePwa', false);
  13 +
10 res.jsonp({ 14 res.jsonp({
11 - usePwa: true 15 + usePwa: !closeUserPwa
12 }); 16 });
13 } 17 }
14 }; 18 };