Authored by liuyue

限购商品

@@ -93,34 +93,34 @@ edit.prototype={ @@ -93,34 +93,34 @@ edit.prototype={
93 }); 93 });
94 94
95 /*时间插件初始化*/ 95 /*时间插件初始化*/
96 - var fdatepicker={};  
97 - $("input[jsaction]",that.el)  
98 - .add("input[jsaction]",that.el)  
99 - .each(function(){  
100 - var $this=$(this);  
101 - var name=$this.attr("id"),  
102 - arr=String.prototype.split.call($this.attr("jsaction"),':');  
103 - var obj=$("#"+name).fdatepicker({  
104 - format: arr[0]=="date"?'yyyy-mm-dd':'yyyy-mm-dd hh:ii:ss',  
105 - pickTime: arr[0]=="date"?false:true 96 + var fdatepicker = {};
  97 + $("input[jsaction]", that.el)
  98 + .add("input[jsaction]", that.el)
  99 + .each(function() {
  100 + var $this = $(this);
  101 + var name = $this.attr("id"),
  102 + arr = String.prototype.split.call($this.attr("jsaction"), ':');
  103 + var obj = $("#" + name).fdatepicker({
  104 + format: arr[0] == "date" ? 'yyyy-mm-dd' : 'yyyy-mm-dd hh:ii:ss',
  105 + pickTime: arr[0] == "date" ? false : true
106 }).data("datepicker"); 106 }).data("datepicker");
107 107
108 - fdatepicker[name]={  
109 - obj:obj,  
110 - action:arr[1]?(arr[1]==="end"?"setEndDate":"setStartDate"):false,  
111 - target:arr[2]?"#"+arr[2]:false 108 + fdatepicker[name] = {
  109 + obj: obj,
  110 + action: arr[1] ? (arr[1] === "end" ? "setEndDate" : "setStartDate") : false,
  111 + target: arr[2] ? "#" + arr[2] : false
112 }; 112 };
113 }); 113 });
114 - for(var key in fdatepicker){  
115 - var obj=fdatepicker[key].obj;  
116 - var action=fdatepicker[key].action;  
117 - var target=fdatepicker[key].target;  
118 - if(action){  
119 - (function(obj,action,target){  
120 - $("#"+key).click(function(){  
121 - obj[action]($(target).val().replace(/\s.*/,'')); 114 + for (var key in fdatepicker) {
  115 + var obj = fdatepicker[key].obj;
  116 + var action = fdatepicker[key].action;
  117 + var target = fdatepicker[key].target;
  118 + if (action) {
  119 + (function(obj, action, target) {
  120 + $("#" + key).click(function() {
  121 + obj[action]($(target).val().replace(/\s.*/, ''));
122 }); 122 });
123 - })(obj,action,target); 123 + })(obj, action, target);
124 } 124 }
125 } 125 }
126 126
@@ -161,8 +161,6 @@ common.edit.ajaxfileupload("#upload-input", { @@ -161,8 +161,6 @@ common.edit.ajaxfileupload("#upload-input", {
161 161
162 if (response.data.succesList && response.data.succesList.length > 0) { 162 if (response.data.succesList && response.data.succesList.length > 0) {
163 common.util.__tip(response.message, 'success'); 163 common.util.__tip(response.message, 'success');
164 - } else {  
165 - common.util.__tip('没有成功导入的数据', 'warning');  
166 } 164 }
167 } else { 165 } else {
168 common.util.__tip(response.message, 'warning'); 166 common.util.__tip(response.message, 'warning');
@@ -8,6 +8,7 @@ var $ = require('jquery'), @@ -8,6 +8,7 @@ var $ = require('jquery'),
8 common = require('../common/common'); 8 common = require('../common/common');
9 9
10 require('../common/bootstrap-wysihtml5'); 10 require('../common/bootstrap-wysihtml5');
  11 +require('../util/datepicker');
11 12
12 var ENMA = { 13 var ENMA = {
13 attachType: { 14 attachType: {
@@ -28,6 +29,8 @@ if ($("#saleTime").data("time")) { @@ -28,6 +29,8 @@ if ($("#saleTime").data("time")) {
28 $("#saleTime").val(date); 29 $("#saleTime").val(date);
29 } 30 }
30 31
  32 +
  33 +
31 //测试数据 34 //测试数据
32 var g = new common.grid({ 35 var g = new common.grid({
33 el: "#baseTable", 36 el: "#baseTable",
@@ -108,22 +111,29 @@ e.on("validate", function() { @@ -108,22 +111,29 @@ e.on("validate", function() {
108 return "请上传默认封面"; 111 return "请上传默认封面";
109 } 112 }
110 }); 113 });
111 -e.on("validate",function(){  
112 - var limitProductType=$("#limitProductType").val();  
113 - var activityId=$.trim($("#activityId").val());  
114 - if(limitProductType==2&&activityId==""){ 114 +e.on("validate", function() {
  115 + var limitProductType = $("#limitProductType").val();
  116 + var activityId = $.trim($("#activityId").val());
  117 + if (limitProductType == 2 && activityId == "") {
115 return "请填写排队限购ID"; 118 return "请填写排队限购ID";
116 } 119 }
117 }) 120 })
118 121
119 e.init(); 122 e.init();
120 123
  124 +console.log($('#saleTime').val().slice(0, -3));
121 //添加修改 125 //添加修改
122 $('.limit-add-btn').click(function(option) { 126 $('.limit-add-btn').click(function(option) {
123 e.submit($('#limit-add-form').attr('action'), function(option) { 127 e.submit($('#limit-add-form').attr('action'), function(option) {
  128 + var saleTime = new Date(option.data.saleTime.replace(/-/g, '/'));
124 //option.debug=true; 129 //option.debug=true;
125 option.data.attachmentContent = JSON.stringify(g.__rows); 130 option.data.attachmentContent = JSON.stringify(g.__rows);
126 - option.data.saleTime = new Date(option.data.saleTime.replace('-', ',')).getTime() / 1000; 131 +
  132 + /*if ($('input[name="dayFlag"]:checked').val() == 0) {
  133 + saleTime = new Date(option.data.saleTime.slice(0, -3).replace(/-/g, '/'));
  134 + }*/
  135 + option.data.saleTime = saleTime.getTime() / 1000;
  136 + console.log(option.data);
127 option.success = function(res) { 137 option.success = function(res) {
128 res = res.data; 138 res = res.data;
129 if (res.code == "200") { 139 if (res.code == "200") {
@@ -145,24 +155,25 @@ $('.limit-add-btn').click(function(option) { @@ -145,24 +155,25 @@ $('.limit-add-btn').click(function(option) {
145 // var $editor = $('#editor'), //文字,图片,视频容器 155 // var $editor = $('#editor'), //文字,图片,视频容器
146 // type = $('#limit-add-form').attr('type'); 156 // type = $('#limit-add-form').attr('type');
147 157
148 -var Bll={  
149 - imgVideo:function(title,item,index){  
150 - if(item.attachType==2||item.__attachType==2){item.extend="mp4"};  
151 - common.dialog.confirm(title,common.util.__template($("#picDialogTemp").html(),item),function(){  
152 - var _html=$.trim($("#imgVideoText").val()); 158 +var Bll = {
  159 + imgVideo: function(title, item, index) {
  160 + if (item.attachType == 2 || item.__attachType == 2) {
  161 + item.extend = "mp4"
  162 + };
  163 + common.dialog.confirm(title, common.util.__template($("#picDialogTemp").html(), item), function() {
  164 + var _html = $.trim($("#imgVideoText").val());
153 165
154 - if(_html){  
155 - if(item.attachType){ 166 + if (_html) {
  167 + if (item.attachType) {
156 //修改 168 //修改
157 - g.__rows[index].attachUrl=_html;  
158 - }  
159 - else{ 169 + g.__rows[index].attachUrl = _html;
  170 + } else {
160 //添加 171 //添加
161 g.__rows.push({ 172 g.__rows.push({
162 "attachType": item.__attachType, 173 "attachType": item.__attachType,
163 "attachUrl": _html, 174 "attachUrl": _html,
164 "isDefault": 0, 175 "isDefault": 0,
165 - "attachName":$("#attachName").val() 176 + "attachName": $("#attachName").val()
166 }); 177 });
167 } 178 }
168 179
@@ -234,164 +245,3 @@ $('body').on('click', ".edit", function() { @@ -234,164 +245,3 @@ $('body').on('click', ".edit", function() {
234 var item = g.rows[$(this).data("index")]; 245 var item = g.rows[$(this).data("index")];
235 Bll[item.attachType == 3 ? "wenZi" : "imgVideo"]("修改" + ENMA.attachType[item.attachType], item, $(this).data("index")); 246 Bll[item.attachType == 3 ? "wenZi" : "imgVideo"]("修改" + ENMA.attachType[item.attachType], item, $(this).data("index"));
236 }); 247 });
237 -  
238 -  
239 -// //添加图片  
240 -// $('body').on('click', '#picDialog', function() {  
241 -  
242 -// common.dialog.confirm("添加图片",common.util.__template($("#picDialogTemp").html(),{name:"图片", fileId: "imgUpload"}),function(){  
243 -  
244 -// var imgStr = '<img src="' + $('#imgUpload').attr('value') + '">';  
245 -// var $oImg = $('<div class="quota-content quota-img" data-type="1">' + imgStr + '<a href="javascript:;" class="editor-delete btn btn-default">删除</a></div>');  
246 -  
247 -// $oImg.appendTo($editor);  
248 -// });  
249 -// var a = new common.edit("#upload-wrapper");  
250 -// a.init();  
251 -  
252 -// return false;  
253 -// });  
254 -  
255 -// //添加视频  
256 -// $('body').on('click', '#videoDialog', function() {  
257 -// common.dialog.confirm("添加视频",common.util.__template($("#picDialogTemp").html(),{name:"视频"}),function(){  
258 -  
259 -// /*var imgStr = '<img src="http://img11.static.yhbimg.com/goodsimg/2015/07/07/08/01315b5bbfd72bc5b59fa2fda6c28b9ae6.jpg">';  
260 -// var $oVideo = $('<div class="quota-imf"><img src="' + imgStr + '" alt="" /></div>');  
261 -  
262 -// $('.quota-video').html(imgStr);*/  
263 -// });  
264 -// var a = new common.edit("#upload-wrapper");  
265 -// a.init();  
266 -// return false;  
267 -  
268 -// });  
269 -  
270 -  
271 -// // 表单验证  
272 -// var limitAddForm = new common.edit("#limit-add-form");  
273 -// limitAddForm.init();  
274 -  
275 -// limitAddForm.on("validate", function(){  
276 -// var param = {  
277 -// batchNo: $('#batchNo').val()  
278 -// }  
279 -// if (type == 'update') {  
280 -// param.id = $('#batchNo').data('id');  
281 -// }  
282 -// /*common.util.__ajax2({  
283 -  
284 -// });*/  
285 -  
286 -  
287 -// });  
288 -  
289 -// //表单提交  
290 -// $('.limit-add-btn').click(function () {  
291 -// var $this = $(this);  
292 -// var param = {  
293 -// batchNo: $('#batchNo').val()  
294 -// }  
295 -// if (type == 'update') {  
296 -// param.id = $('#batchNo').data('id');  
297 -// }  
298 -  
299 -// common.util.__ajax2({  
300 -// url:'/limit/checkBatch',  
301 -// data: param  
302 -// }, function(res) {  
303 -// if (res.code == 200) {  
304 -// limitAddForm.submit($('#limit-add-form').attr('action'), function(option, that) {  
305 -// option.beforeSend = function () {  
306 -// $this.attr('disabled', 'disabled');  
307 -// var param = {  
308 -// batchNo: $('#batchNo').val()  
309 -// }  
310 -// if (type == 'update') {  
311 -// param.id = $('#batchNo').data('id');  
312 -// }  
313 -  
314 -// };  
315 -  
316 -// option.success=function(res){  
317 -// if (res.data.code == 200) {  
318 -// //成功返回列表页  
319 -// limitAddForm.$tip('提交成功',function(){  
320 -// //window.location.href = '/limit/product/index';  
321 -// }, 'growl-success');  
322 -// $this.removeAttr('disabled');  
323 -// } else {  
324 -// limitAddForm.$tip(res.data.message);  
325 -// $this.removeAttr('disabled');  
326 -// }  
327 -// return false;  
328 -// };  
329 -  
330 -// option.error=function(res){  
331 -// limitAddForm.$tip(res.message);  
332 -// $this.removeAttr('disabled');  
333 -// };  
334 -  
335 -// //文字,图片,视频上传数据  
336 -// option.data.attachmentContent = [];  
337 -// option.data.attachmentContent.push({  
338 -// attachUrl:option.data.coverImg,  
339 -// isDefault: 1,  
340 -// attachType: 1,  
341 -// orderBy: 0  
342 -// });  
343 -// if ($('.quota-content').size() > 0) {  
344 -// $('.quota-content').each(function(i) {  
345 -// var editType = $(this).data('type'),  
346 -// content = '',  
347 -// obj = {  
348 -// attachType: editType, //上传内容类型,1:图片, 2:视频,3:文字  
349 -// isDefault: 0, //是否封面图  
350 -// orderBy: i //排序  
351 -// };  
352 -  
353 -// if (editType == 3) {  
354 -// content = $(this).find('span').text();  
355 -// obj.intro = content; //文字key为intro  
356 -// } else if (editType == 1) {  
357 -// content = $(this).find('img').attr('src');  
358 -// obj.attachUrl = content; //图片key为attachUrl  
359 -// }  
360 -// option.data.attachmentContent.push(obj)  
361 -// });  
362 -// }  
363 -  
364 -// //因为只能传字符串,转换为字符串  
365 -// option.data.attachmentContent = JSON.stringify(option.data.attachmentContent);  
366 -  
367 -// //时间上传为时间戳  
368 -// option.data.saleTime = new Date(option.data.saleTime.replace('-',',')).getTime() / 1000;  
369 -// console.log(option.data);  
370 -  
371 -// });  
372 -// }  
373 -// });  
374 -  
375 -  
376 -// });  
377 -  
378 -// //编辑页,时间戳转换  
379 -// $('#saleTime').val(function() {  
380 -// if ($(this).data('time')) {  
381 -// var date = new Date($(this).data('time') * 1000);  
382 -// return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();  
383 -// }  
384 -// });  
385 -  
386 -// //富文本删除事件  
387 -// $('#limit-add-form').on('click', '.editor-delete', function() {  
388 -// $(this).parents('.quota-content').remove();  
389 -// });  
390 -  
391 -// $('input[name="hotFlag"]').on('click', function() {  
392 -// if ($(this).val() == 0) {  
393 -// $('#orderBy').attr('disabled', true);  
394 -// } else {  
395 -// $('#orderBy').removeAttr('disabled');  
396 -// }  
397 -// });  
@@ -2,44 +2,42 @@ exports.domain = require('../config/common.js').domain; @@ -2,44 +2,42 @@ exports.domain = require('../config/common.js').domain;
2 //exports.domain = 'http://172.16.6.240:8088/platform'; 2 //exports.domain = 'http://172.16.6.240:8088/platform';
3 3
4 //路由配置 4 //路由配置
5 -exports.res = [  
6 - { 5 +exports.res = [{
7 //【限购商品】页面渲染 6 //【限购商品】页面渲染
8 route: '/limit/product/index', 7 route: '/limit/product/index',
9 method: 'GET', 8 method: 'GET',
10 view: 'pages/limit/index', 9 view: 'pages/limit/index',
11 src: '/product/limit' 10 src: '/product/limit'
12 - }, { 11 +}, {
13 // 【限购商品】ajax分页 12 // 【限购商品】ajax分页
14 route: '/limit/product/page', 13 route: '/limit/product/page',
15 method: 'POST', 14 method: 'POST',
16 url: '/limitProduct/getLimitProductList', 15 url: '/limitProduct/getLimitProductList',
17 - params: [  
18 - { 16 + params: [{
19 name: 'hotFlag', 17 name: 'hotFlag',
20 type: 'Number' 18 type: 'Number'
21 - },{ 19 + }, {
22 name: 'saleFlag', 20 name: 'saleFlag',
23 type: 'Number' 21 type: 'Number'
24 - },{ 22 + }, {
25 name: 'showFlag', 23 name: 'showFlag',
26 type: 'Number' 24 type: 'Number'
27 - },{ 25 + }, {
28 name: 'productName', 26 name: 'productName',
29 type: 'String' 27 type: 'String'
30 - },{ 28 + }, {
31 name: 'productSkn', 29 name: 'productSkn',
32 type: 'String' 30 type: 'String'
33 - },{ 31 + }, {
34 name: 'page', 32 name: 'page',
35 type: 'Number' 33 type: 'Number'
36 - },{ 34 + }, {
37 name: 'size', 35 name: 'size',
38 type: 'Number' 36 type: 'Number'
39 } 37 }
40 38
41 ] 39 ]
42 - },{ 40 +}, {
43 // 【限购商品】添加页面渲染 41 // 【限购商品】添加页面渲染
44 route: '/limit/product/add', 42 route: '/limit/product/add',
45 method: 'GET', 43 method: 'GET',
@@ -49,166 +47,143 @@ exports.res = [ @@ -49,166 +47,143 @@ exports.res = [
49 data: {}, 47 data: {},
50 action: '/limit/product/add' 48 action: '/limit/product/add'
51 } 49 }
52 - },{ 50 +}, {
53 // 【限购商品】ajax添加 51 // 【限购商品】ajax添加
54 route: '/limit/product/add', 52 route: '/limit/product/add',
55 method: 'POST', 53 method: 'POST',
56 url: '/limitProduct/addLimitProduct', 54 url: '/limitProduct/addLimitProduct',
57 - params: [  
58 - { 55 + params: [{
59 name: 'productName', 56 name: 'productName',
60 type: 'String' 57 type: 'String'
61 - },  
62 - { 58 + }, {
63 name: 'attachmentContent', 59 name: 'attachmentContent',
64 type: 'String' 60 type: 'String'
65 - },  
66 - { 61 + }, {
67 name: 'batchNo', 62 name: 'batchNo',
68 type: 'Number' 63 type: 'Number'
69 - },{ 64 + }, {
70 name: 'saleTime', 65 name: 'saleTime',
71 type: 'String' 66 type: 'String'
72 - },{ 67 + }, {
73 name: 'hotFlag', 68 name: 'hotFlag',
74 type: 'Number' 69 type: 'Number'
75 - },{  
76 - name:'orderBy', 70 + }, {
  71 + name: 'orderBy',
77 type: 'Number' 72 type: 'Number'
78 - },{ 73 + }, {
79 name: 'notSaleOrderBy', 74 name: 'notSaleOrderBy',
80 type: 'Number' 75 type: 'Number'
81 - },{  
82 - name:'limitProductType',  
83 - type:'Number'  
84 - },  
85 - {  
86 - name:'activityId',  
87 - type:'Number'  
88 - }  
89 - ]  
90 -  
91 }, { 76 }, {
  77 + name: 'limitProductType',
  78 + type: 'Number'
  79 + }, {
  80 + name: 'activityId',
  81 + type: 'Number'
  82 + }]
  83 +
  84 +}, {
92 route: '/limit/edit/:id', 85 route: '/limit/edit/:id',
93 method: 'GET', 86 method: 'GET',
94 view: 'pages/limit/add', 87 view: 'pages/limit/add',
95 url: '/limitProduct/getLimitProduct', 88 url: '/limitProduct/getLimitProduct',
96 - data:{  
97 - action:"/limit/update",  
98 - type:"update" 89 + data: {
  90 + action: "/limit/update",
  91 + type: "update"
99 }, 92 },
100 - src:'/product/limit-add',  
101 - params:[  
102 - {name:"id",type:"String"}  
103 - ]  
104 - }, { 93 + src: '/product/limit-add',
  94 + params: [{
  95 + name: "id",
  96 + type: "String"
  97 + }]
  98 +}, {
105 route: '/limit/update', 99 route: '/limit/update',
106 method: 'POST', 100 method: 'POST',
107 url: '/limitProduct/updateLimitProduct', 101 url: '/limitProduct/updateLimitProduct',
108 - params: [  
109 - { 102 + params: [{
110 name: 'id', 103 name: 'id',
111 type: 'Number' 104 type: 'Number'
112 - },  
113 - { 105 + }, {
114 name: 'productName', 106 name: 'productName',
115 type: 'String' 107 type: 'String'
116 - },  
117 - { 108 + }, {
118 name: 'attachmentContent', 109 name: 'attachmentContent',
119 type: 'String' 110 type: 'String'
120 - },  
121 - { 111 + }, {
122 name: 'batchNo', 112 name: 'batchNo',
123 type: 'Number' 113 type: 'Number'
124 - },{ 114 + }, {
125 name: 'saleTime', 115 name: 'saleTime',
126 type: 'String' 116 type: 'String'
127 - },{ 117 + }, {
128 name: 'hotFlag', 118 name: 'hotFlag',
129 type: 'Number' 119 type: 'Number'
130 - },{  
131 - name:'orderBy', 120 + }, {
  121 + name: 'orderBy',
132 type: 'Number' 122 type: 'Number'
133 - },{ 123 + }, {
134 name: 'notSaleOrderBy', 124 name: 'notSaleOrderBy',
135 type: 'Number' 125 type: 'Number'
136 }, { 126 }, {
137 name: 'dayFlag', 127 name: 'dayFlag',
138 type: 'Number' 128 type: 'Number'
139 - }  
140 - ]  
141 - }, { 129 + }]
  130 +}, {
142 route: '/limit/ajax/getCodeCount', 131 route: '/limit/ajax/getCodeCount',
143 method: 'POST', 132 method: 'POST',
144 url: '/limitProduct/getCountByStatus', 133 url: '/limitProduct/getCountByStatus',
145 - params: [  
146 - { 134 + params: [{
147 name: 'hotFlag', 135 name: 'hotFlag',
148 type: 'Number' 136 type: 'Number'
149 - },{ 137 + }, {
150 name: 'saleFlag', 138 name: 'saleFlag',
151 type: 'Number' 139 type: 'Number'
152 - },{ 140 + }, {
153 name: 'showFlag', 141 name: 'showFlag',
154 type: 'Number' 142 type: 'Number'
155 - },{ 143 + }, {
156 name: 'productName', 144 name: 'productName',
157 type: 'String' 145 type: 'String'
158 - },{ 146 + }, {
159 name: 'productSkn', 147 name: 'productSkn',
160 type: 'String' 148 type: 'String'
161 - }  
162 - ]  
163 - }, { 149 + }]
  150 +}, {
164 route: '/limit/audit', 151 route: '/limit/audit',
165 method: 'POST', 152 method: 'POST',
166 url: '/limitProduct/auditLimitProduct', 153 url: '/limitProduct/auditLimitProduct',
167 - params: [  
168 - { 154 + params: [{
169 name: 'id', 155 name: 'id',
170 type: 'Number' 156 type: 'Number'
171 - },  
172 - { 157 + }, {
173 name: 'showFlag', 158 name: 'showFlag',
174 type: 'Number' 159 type: 'Number'
175 - },  
176 - { 160 + }, {
177 name: 'hotFlag', 161 name: 'hotFlag',
178 type: 'Number' 162 type: 'Number'
179 - },  
180 - { 163 + }, {
181 name: 'orderBy', 164 name: 'orderBy',
182 type: 'Number' 165 type: 'Number'
183 - },  
184 - { 166 + }, {
185 name: 'notSaleOrderBy', 167 name: 'notSaleOrderBy',
186 type: 'Number' 168 type: 'Number'
187 - }  
188 - ]  
189 - }, { 169 + }]
  170 +}, {
190 route: '/limit/delete', 171 route: '/limit/delete',
191 method: 'POST', 172 method: 'POST',
192 url: '/limitProduct/deleteLimitProduct', 173 url: '/limitProduct/deleteLimitProduct',
193 - params: [  
194 - { 174 + params: [{
195 name: 'id', 175 name: 'id',
196 type: 'Number' 176 type: 'Number'
197 - }  
198 - ]  
199 - }, { 177 + }]
  178 +}, {
200 route: '/limit/checkBatch', 179 route: '/limit/checkBatch',
201 method: 'POST', 180 method: 'POST',
202 url: '/limitProduct/checkBatchNoExist', 181 url: '/limitProduct/checkBatchNoExist',
203 - params: [  
204 - { 182 + params: [{
205 name: 'batchNo', 183 name: 'batchNo',
206 type: 'Number' 184 type: 'Number'
207 - },  
208 - { 185 + }, {
209 name: 'id', 186 name: 'id',
210 type: 'Number' 187 type: 'Number'
211 - }  
212 - ]  
213 - }  
214 -]; 188 + }]
  189 +}];
1 var request = require('request'); 1 var request = require('request');
2 var fs = require('fs'); 2 var fs = require('fs');
3 -var domain = require('../../config/common.js').domain; 3 +//var domain = require('../../config/common.js').domain;
4 //var domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力 4 //var domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力
5 -//var domain = 'http://192.168.102.202:8088/platform'; 5 +var domain = 'http://192.168.102.202:8088/platform';
6 6
7 var env = process.env.NODE_ENV || 'development'; 7 var env = process.env.NODE_ENV || 'development';
8 8
@@ -14,8 +14,8 @@ exports.uploadFile = function(req, res) { @@ -14,8 +14,8 @@ exports.uploadFile = function(req, res) {
14 url: domain + '/batch/import', 14 url: domain + '/batch/import',
15 formData: req.body 15 formData: req.body
16 }, function optionalCallback(err, httpResponse, body) { 16 }, function optionalCallback(err, httpResponse, body) {
17 - var json=JSON.parse(body);  
18 - json.status=true; 17 + var json = JSON.parse(body);
  18 + json.status = true;
19 res.json(json); 19 res.json(json);
20 }); 20 });
21 } else { 21 } else {
@@ -23,8 +23,8 @@ exports.uploadFile = function(req, res) { @@ -23,8 +23,8 @@ exports.uploadFile = function(req, res) {
23 url: domain + '/fileupload/upload', 23 url: domain + '/fileupload/upload',
24 formData: req.body 24 formData: req.body
25 }, function optionalCallback(err, httpResponse, body) { 25 }, function optionalCallback(err, httpResponse, body) {
26 - var json=JSON.parse(body);  
27 - json.status=true; 26 + var json = JSON.parse(body);
  27 + json.status = true;
28 res.json(json); 28 res.json(json);
29 }); 29 });
30 } 30 }