...
|
...
|
@@ -12,7 +12,8 @@ var grayroute = require("./mid/grayrouter"); |
|
|
/*session 配置*/
|
|
|
var options = {
|
|
|
secret: 'yohobuy.shops', //session配置
|
|
|
cookie: {secure: false, maxAge: 7200000},
|
|
|
// cookie: {secure: false, maxAge: 7200000},
|
|
|
cookie: {secure: false, maxAge: 7200000, domain: '.yohobuy.com'},
|
|
|
resave: false,
|
|
|
saveUninitialized: true,
|
|
|
rolling: true
|
...
|
...
|
@@ -72,6 +73,15 @@ var apiCofig = { |
|
|
host: 'localhost'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if(process.env.NODE_ENV==="gray"){
|
|
|
options.cookie.domain = '';
|
|
|
}
|
|
|
|
|
|
if(process.env.NODE_ENV==="production"){
|
|
|
options.cookie.domain = '.yohobuy.com';
|
|
|
}
|
|
|
|
|
|
app.use(session(options));
|
|
|
},
|
|
|
useToOuter:function(app,controllers){
|
...
|
...
|
|