|
@@ -7,6 +7,7 @@ |
|
@@ -7,6 +7,7 @@ |
7
|
'use strict';
|
7
|
'use strict';
|
8
|
const mRoot = '../models';
|
8
|
const mRoot = '../models';
|
9
|
const outlets = require(`${mRoot}/outlets`);
|
9
|
const outlets = require(`${mRoot}/outlets`);
|
|
|
10
|
+const log = require(`${global.library}/logger`);
|
10
|
|
11
|
|
11
|
/**
|
12
|
/**
|
12
|
* outlets 首页
|
13
|
* outlets 首页
|
|
@@ -27,7 +28,8 @@ exports.index = (req, res) => { |
|
@@ -27,7 +28,8 @@ exports.index = (req, res) => { |
27
|
resData.headerData = result.headerData;
|
28
|
resData.headerData = result.headerData;
|
28
|
resData.resultShow = JSON.stringify(result, null, 4);
|
29
|
resData.resultShow = JSON.stringify(result, null, 4);
|
29
|
res.render('outlets/index', resData);
|
30
|
res.render('outlets/index', resData);
|
30
|
- }).catch(() => {
|
31
|
+ }).catch((e) => {
|
|
|
32
|
+ log.error(e);
|
31
|
resData.pageErr = true;
|
33
|
resData.pageErr = true;
|
32
|
res.render('error', resData);
|
34
|
res.render('error', resData);
|
33
|
});
|
35
|
});
|
|
@@ -48,7 +50,8 @@ exports.channel = (req, res) => { |
|
@@ -48,7 +50,8 @@ exports.channel = (req, res) => { |
48
|
|
50
|
|
49
|
outlets.getOutletsChannelData(req.query, req.params.channel).then(result => {
|
51
|
outlets.getOutletsChannelData(req.query, req.params.channel).then(result => {
|
50
|
res.render('outlets/channel', Object.assign(resData, result));
|
52
|
res.render('outlets/channel', Object.assign(resData, result));
|
51
|
- }).catch(() => {
|
53
|
+ }).catch((e) => {
|
|
|
54
|
+ log.error(e);
|
52
|
resData.pageErr = true;
|
55
|
resData.pageErr = true;
|
53
|
res.render('error', resData);
|
56
|
res.render('error', resData);
|
54
|
});
|
57
|
});
|
|
@@ -74,7 +77,8 @@ exports.special = (req, res) => { |
|
@@ -74,7 +77,8 @@ exports.special = (req, res) => { |
74
|
|
77
|
|
75
|
outlets.getOutletsSpecialData(params, channel).then(result => {
|
78
|
outlets.getOutletsSpecialData(params, channel).then(result => {
|
76
|
res.render('outlets/special', Object.assign(resData, result));
|
79
|
res.render('outlets/special', Object.assign(resData, result));
|
77
|
- }).catch(() => {
|
80
|
+ }).catch((e) => {
|
|
|
81
|
+ log.error(e);
|
78
|
resData.pageErr = true;
|
82
|
resData.pageErr = true;
|
79
|
res.render('error', resData);
|
83
|
res.render('error', resData);
|
80
|
});
|
84
|
});
|
|
@@ -101,7 +105,8 @@ exports.list = (req, res) => { |
|
@@ -101,7 +105,8 @@ exports.list = (req, res) => { |
101
|
outlets.getOutletsCategoryData(params, channel).then((result) => {
|
105
|
outlets.getOutletsCategoryData(params, channel).then((result) => {
|
102
|
responseData.resultShow = JSON.stringify(result, null, 4);
|
106
|
responseData.resultShow = JSON.stringify(result, null, 4);
|
103
|
res.render('sale/other', Object.assign(responseData, result));
|
107
|
res.render('sale/other', Object.assign(responseData, result));
|
104
|
- }).catch(() => {
|
108
|
+ }).catch((e) => {
|
|
|
109
|
+ log.error(e);
|
105
|
responseData.pageErr = true;
|
110
|
responseData.pageErr = true;
|
106
|
res.render('error', responseData);
|
111
|
res.render('error', responseData);
|
107
|
});
|
112
|
});
|