Authored by liuyue

Merge branch 'develop' of git.dev.yoho.cn:platform/yohobuy-portal-fe into develop

... ... @@ -35,7 +35,7 @@ var dist_dir = {
};
var cdn_domain = 'http://cdn.yoho.cn/';
var md5="-"+crypto.createHash('md5').update(new Date().toString()).digest('hex');;
var md5= "";//"-"+crypto.createHash('md5').update(new Date().toString()).digest('hex');;
var ftpConfig = {
host: '218.94.75.58',
... ...
... ... @@ -80,17 +80,9 @@ var util={
result = result.replace(reg, args[1][key]);
}
}
//clear {xxx}
var reg = new RegExp("({.*})", "g");
result = result.replace(reg, '');
} else {
for (var i = 1; i < args.length; i++) {
if (args[i] != undefined) {
var reg = new RegExp("({[" + (i - 1) + "]})", "g");
result = result.replace(reg, args[i]);
}
}
}
}
var reg = new RegExp("({.*})", "g");
result = result.replace(reg, '');
}
}
return result;
... ...
... ... @@ -77,10 +77,9 @@ var dropDown = require('../common/dropDown');
$.ajax({
type: 'POST',
dataType: 'json',
url: '/product/sort/update',
url: status?"/erpproduct/sorter/open":"/erpproduct/sorter/close",
data: {
id: $target.closest('td').attr('data-id'),
status: status
param: $target.closest('td').attr('data-id')
}
}).then(function (data) {
... ...
var config = require('../config/gray');
var request = require('request');
var options=require('../staticConfig.js').staticDir;
var CSS_FILE = '/css/all.css';
var env = process.env.NODE_ENV || 'development';
//设置对于环境环境
if(env!=='development') {
CSS_FILE = options[env].path+'/all.css';
}
/**
* 登陆逻辑,跳转处理
* @param {Object} data 通过接口获取到的数据
... ... @@ -45,14 +56,14 @@ exports.post = function(data, req, res) {
res.redirect(url);
} else {
res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false});
res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false,cssfile:CSS_FILE});
}
});
return;
} else {
//否则跳转错误
res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false});
res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false,cssfile:CSS_FILE});
return;
}
}
\ No newline at end of file
... ...
... ... @@ -26,7 +26,7 @@ exports.res =
type: 'String',
maxLength: 16,
minLength: 6,
reg: /[0-9A-Za-z]{6,16}/,
reg: /^\S{6,16}/,
message: '必须是6-16位的字符'
}]
},{
... ...
... ... @@ -118,6 +118,24 @@ exports.res = [
}
]
},{
route:"/erpproduct/sorter/open",
method: 'POST',
url: '/product/publishProductSort',
isJsonRaw:true,
params: [{
name: 'param',
type: 'Number'
}]
},{
route:"/erpproduct/sorter/close",
method: 'POST',
url: '/product/closeProductSort',
isJsonRaw:true,
params: [{
name: 'param',
type: 'Number'
}]
},{
//商品管理>【产品属性】页面渲染
route: '/erpproduct/attribute/index',
method: 'GET',
... ...
... ... @@ -20,6 +20,16 @@ var NO_AUTH = '没有权限!';
var WEBSITE = 1;
var CSS_FILE = '/css/all.css';
var env = process.env.NODE_ENV || 'development';
//设置对于环境环境
if(env!=='development') {
CSS_FILE = options[env].path+'/all.css';
}
/**
* 认证中间件
* @param {Object} req 请求对象
... ... @@ -37,7 +47,7 @@ module.exports = function(req, res, next) {
var path = req.route?req.route.path:'';
if(req.session.user&&!checkPath(req.path,req)) {
res.status(403);
res.render('error/error_nolayout',{message:NO_AUTH,layout:false});
res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE});
return;
}
//进行白名单验证和session验证
... ... @@ -58,7 +68,7 @@ module.exports = function(req, res, next) {
} else {
req.app.logger.log('info',"CurentView:Login");
//如果是登陆界面不加载布局
res.render('pages/login',{layout:false});
res.render('pages/login',{layout:false,cssfile:CSS_FILE});
}
}
... ...
... ... @@ -7,7 +7,7 @@
<title>error</title>
<link href="/css/all.css" rel="stylesheet">
<link href="{{cssfile}}" rel="stylesheet">
</head>
<body class="pace-done">
... ...
... ... @@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="/dist/index.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<link href="{{cssfile}}" rel="stylesheet" type="text/css" media="screen" />
</head>
<body class="signin">
<section>
<div class="panel panel-signin">
... ...
... ... @@ -118,7 +118,7 @@
<script type="text/template" id="template-endtime">
<div class="form-group">
<label for="endtime" class="col-sm-2 control-label"><i class="red">*</i> 结束时间</label>
<label for="endTime" class="col-sm-2 control-label"><i class="red">*</i> 结束时间</label>
<div class="col-sm-10">
<input type="text" id="endTime" class="form-control panel-input hasDatepicker" jsaction="time:start:startTime" name="start_time" placeholder="结束时间" value="{endTime}">
</div>
... ...
... ... @@ -2,6 +2,6 @@
{{#if _env.development}}
<link rel="stylesheet" type="text/css" href="/dist/index.css">
{{else}}
<link rel="stylesheet" href="{{_env.cur.path}}/index.css">
<link rel="stylesheet" href="{{../_env.cur.path}}/index.css">
{{/if}}
{{/if}}
... ...