Authored by xuhongyun

Merge branch 'master' into dev_2.5_基础网销

... ... @@ -9,6 +9,18 @@ module.exports=function(app) {
app.post("/login", "common_login", function (login, req, res){
if (login.code == 200) {
if (req.session.gray) {
// 登录成功后,将phpsession保存下来
var gray_cookie = req.session.gray.replace(/[\[|\]]/g, '').split(';');
gray_cookie.forEach(function (n) {
console.log(n);
var item = n.split("=");
if (item.length > 1 && item[0] == "PHPSESSID") {
res.cookie(item[0], item[1], { maxAge: 7200000, httpOnly: true, domain: ".yohobuy.com" });
}
});
}
return res.json({
code: 200,
message: login.message
... ...
... ... @@ -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){
... ...
... ... @@ -393,7 +393,7 @@ loadtab();
//筛选
$("#filter-btn").click(function() {
loadtab();
$('#basicTab li:eq(5)').click(); // 每次点击筛选,需要先跳转到“全部”页签下面
//$('#basicTab li:eq(5)').click(); // 每次点击筛选,需要先跳转到“全部”页签下面
g.reload(1);
});
... ...
... ... @@ -47,16 +47,6 @@ var g = new common.grid({
}
}
}, {
display: "创建时间",
name: "createTime",
render: function(item) {
if (item.createTime) {
return common.util.__dateFormat(new Date(item.createTime * 1000), "yyyy-MM-dd hh:mm:ss");
} else {
return '';
}
}
}, {
display: "更新时间",
name: "updateTime",
render: function(item) {
... ... @@ -67,6 +57,20 @@ var g = new common.grid({
}
}
}, {
display: "开店时间",
render: function(item) {
var htmArr = [];
if(item.openTime && item.openTime != 0) {
htmArr.push("<p>有货店铺: " + common.util.__dateFormat(new Date(item.openTime * 1000), "yyyy-MM-dd hh:mm:ss") + "</p>");
}
if(item.blkOpenTime && item.blkOpenTime != 0) {
htmArr.push("<p>BLK店铺: " + common.util.__dateFormat(new Date(item.blkOpenTime * 1000), "yyyy-MM-dd hh:mm:ss") + "</p>");
}
return htmArr.join(' ');
}
}, {
display: "状态",
name: "checkStatus",
render: function(item) {
... ...