• This project
    • Loading...
  • Sign in

fe / yohobuywap-node · Files

Go to a project

GitLab

  • Go to group
  • Project
  • Activity
  • Files
  • Commits
  • Pipelines 0
  • Builds 0
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Members
  • Labels
  • Wiki
  • Forks
  • Network
  • Create a new issue
  • yohobuywap-node
  • apps
  • api
  • controllers
  • switch.js
  • usePwa
    5a2c47d6
    by 郭成尧
    2018-01-23 14:10:57 +0800  
    Browse Directory »
switch.js 425 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
const _ = require('lodash');

module.exports = {
    index(req, res) {
        // 千万别缓存
        res.set({
            'Cache-Control': 'no-cache',
            Pragma: 'no-cache',
            Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString()
        });

        let closeUserPwa = _.get(req.app.locals.wap, 'close.usePwa', false);

        res.jsonp({
            usePwa: !closeUserPwa
        });
    }
};