Authored by liuyue

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

@@ -35,7 +35,7 @@ var dist_dir = { @@ -35,7 +35,7 @@ var dist_dir = {
35 }; 35 };
36 36
37 var cdn_domain = 'http://cdn.yoho.cn/'; 37 var cdn_domain = 'http://cdn.yoho.cn/';
38 -var md5="-"+crypto.createHash('md5').update(new Date().toString()).digest('hex');; 38 +var md5= "";//"-"+crypto.createHash('md5').update(new Date().toString()).digest('hex');;
39 39
40 var ftpConfig = { 40 var ftpConfig = {
41 host: '218.94.75.58', 41 host: '218.94.75.58',
@@ -80,17 +80,9 @@ var util={ @@ -80,17 +80,9 @@ var util={
80 result = result.replace(reg, args[1][key]); 80 result = result.replace(reg, args[1][key]);
81 } 81 }
82 } 82 }
83 - //clear {xxx} 83 + }
84 var reg = new RegExp("({.*})", "g"); 84 var reg = new RegExp("({.*})", "g");
85 result = result.replace(reg, ''); 85 result = result.replace(reg, '');
86 - } else {  
87 - for (var i = 1; i < args.length; i++) {  
88 - if (args[i] != undefined) {  
89 - var reg = new RegExp("({[" + (i - 1) + "]})", "g");  
90 - result = result.replace(reg, args[i]);  
91 - }  
92 - }  
93 - }  
94 } 86 }
95 } 87 }
96 return result; 88 return result;
@@ -77,10 +77,9 @@ var dropDown = require('../common/dropDown'); @@ -77,10 +77,9 @@ var dropDown = require('../common/dropDown');
77 $.ajax({ 77 $.ajax({
78 type: 'POST', 78 type: 'POST',
79 dataType: 'json', 79 dataType: 'json',
80 - url: '/product/sort/update', 80 + url: status?"/erpproduct/sorter/open":"/erpproduct/sorter/close",
81 data: { 81 data: {
82 - id: $target.closest('td').attr('data-id'),  
83 - status: status 82 + param: $target.closest('td').attr('data-id')
84 } 83 }
85 }).then(function (data) { 84 }).then(function (data) {
86 85
1 1
2 var config = require('../config/gray'); 2 var config = require('../config/gray');
3 var request = require('request'); 3 var request = require('request');
  4 +var options=require('../staticConfig.js').staticDir;
  5 +
  6 +var CSS_FILE = '/css/all.css';
  7 +
  8 +var env = process.env.NODE_ENV || 'development';
  9 +
  10 +//设置对于环境环境
  11 +if(env!=='development') {
  12 + CSS_FILE = options[env].path+'/all.css';
  13 +}
  14 +
4 /** 15 /**
5 * 登陆逻辑,跳转处理 16 * 登陆逻辑,跳转处理
6 * @param {Object} data 通过接口获取到的数据 17 * @param {Object} data 通过接口获取到的数据
@@ -45,14 +56,14 @@ exports.post = function(data, req, res) { @@ -45,14 +56,14 @@ exports.post = function(data, req, res) {
45 res.redirect(url); 56 res.redirect(url);
46 57
47 } else { 58 } else {
48 - res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false}); 59 + res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false,cssfile:CSS_FILE});
49 } 60 }
50 }); 61 });
51 return; 62 return;
52 } else { 63 } else {
53 64
54 //否则跳转错误 65 //否则跳转错误
55 - res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false}); 66 + res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false,cssfile:CSS_FILE});
56 return; 67 return;
57 } 68 }
58 } 69 }
@@ -26,7 +26,7 @@ exports.res = @@ -26,7 +26,7 @@ exports.res =
26 type: 'String', 26 type: 'String',
27 maxLength: 16, 27 maxLength: 16,
28 minLength: 6, 28 minLength: 6,
29 - reg: /[0-9A-Za-z]{6,16}/, 29 + reg: /^\S{6,16}/,
30 message: '必须是6-16位的字符' 30 message: '必须是6-16位的字符'
31 }] 31 }]
32 },{ 32 },{
@@ -118,6 +118,24 @@ exports.res = [ @@ -118,6 +118,24 @@ exports.res = [
118 } 118 }
119 ] 119 ]
120 },{ 120 },{
  121 + route:"/erpproduct/sorter/open",
  122 + method: 'POST',
  123 + url: '/product/publishProductSort',
  124 + isJsonRaw:true,
  125 + params: [{
  126 + name: 'param',
  127 + type: 'Number'
  128 + }]
  129 + },{
  130 + route:"/erpproduct/sorter/close",
  131 + method: 'POST',
  132 + url: '/product/closeProductSort',
  133 + isJsonRaw:true,
  134 + params: [{
  135 + name: 'param',
  136 + type: 'Number'
  137 + }]
  138 + },{
121 //商品管理>【产品属性】页面渲染 139 //商品管理>【产品属性】页面渲染
122 route: '/erpproduct/attribute/index', 140 route: '/erpproduct/attribute/index',
123 method: 'GET', 141 method: 'GET',
@@ -20,6 +20,16 @@ var NO_AUTH = '没有权限!'; @@ -20,6 +20,16 @@ var NO_AUTH = '没有权限!';
20 20
21 var WEBSITE = 1; 21 var WEBSITE = 1;
22 22
  23 +var CSS_FILE = '/css/all.css';
  24 +
  25 +var env = process.env.NODE_ENV || 'development';
  26 +
  27 +//设置对于环境环境
  28 +if(env!=='development') {
  29 + CSS_FILE = options[env].path+'/all.css';
  30 +}
  31 +
  32 +
23 /** 33 /**
24 * 认证中间件 34 * 认证中间件
25 * @param {Object} req 请求对象 35 * @param {Object} req 请求对象
@@ -37,7 +47,7 @@ module.exports = function(req, res, next) { @@ -37,7 +47,7 @@ module.exports = function(req, res, next) {
37 var path = req.route?req.route.path:''; 47 var path = req.route?req.route.path:'';
38 if(req.session.user&&!checkPath(req.path,req)) { 48 if(req.session.user&&!checkPath(req.path,req)) {
39 res.status(403); 49 res.status(403);
40 - res.render('error/error_nolayout',{message:NO_AUTH,layout:false}); 50 + res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE});
41 return; 51 return;
42 } 52 }
43 //进行白名单验证和session验证 53 //进行白名单验证和session验证
@@ -58,7 +68,7 @@ module.exports = function(req, res, next) { @@ -58,7 +68,7 @@ module.exports = function(req, res, next) {
58 } else { 68 } else {
59 req.app.logger.log('info',"CurentView:Login"); 69 req.app.logger.log('info',"CurentView:Login");
60 //如果是登陆界面不加载布局 70 //如果是登陆界面不加载布局
61 - res.render('pages/login',{layout:false}); 71 + res.render('pages/login',{layout:false,cssfile:CSS_FILE});
62 } 72 }
63 } 73 }
64 74
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 7
8 <title>error</title> 8 <title>error</title>
9 9
10 - <link href="/css/all.css" rel="stylesheet"> 10 + <link href="{{cssfile}}" rel="stylesheet">
11 </head> 11 </head>
12 12
13 <body class="pace-done"> 13 <body class="pace-done">
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
6 <meta name="description" content=""> 6 <meta name="description" content="">
7 <meta name="author" content=""> 7 <meta name="author" content="">
8 - <link href="/dist/index.css" rel="stylesheet" type="text/css" media="screen" /> 8 + <link href="{{cssfile}}" rel="stylesheet" type="text/css" media="screen" />
9 </head> 9 </head>
10 <body class="signin"> 10 <body class="signin">
11 <section> 11 <section>
@@ -118,7 +118,7 @@ @@ -118,7 +118,7 @@
118 118
119 <script type="text/template" id="template-endtime"> 119 <script type="text/template" id="template-endtime">
120 <div class="form-group"> 120 <div class="form-group">
121 - <label for="endtime" class="col-sm-2 control-label"><i class="red">*</i> 结束时间</label> 121 + <label for="endTime" class="col-sm-2 control-label"><i class="red">*</i> 结束时间</label>
122 <div class="col-sm-10"> 122 <div class="col-sm-10">
123 <input type="text" id="endTime" class="form-control panel-input hasDatepicker" jsaction="time:start:startTime" name="start_time" placeholder="结束时间" value="{endTime}"> 123 <input type="text" id="endTime" class="form-control panel-input hasDatepicker" jsaction="time:start:startTime" name="start_time" placeholder="结束时间" value="{endTime}">
124 </div> 124 </div>
@@ -2,6 +2,6 @@ @@ -2,6 +2,6 @@
2 {{#if _env.development}} 2 {{#if _env.development}}
3 <link rel="stylesheet" type="text/css" href="/dist/index.css"> 3 <link rel="stylesheet" type="text/css" href="/dist/index.css">
4 {{else}} 4 {{else}}
5 -<link rel="stylesheet" href="{{_env.cur.path}}/index.css"> 5 +<link rel="stylesheet" href="{{../_env.cur.path}}/index.css">
6 {{/if}} 6 {{/if}}
7 {{/if}} 7 {{/if}}