Merge branch 'master' of http://git.yoho.cn/fe/yohobuy-node
Showing
1 changed file
with
12 additions
and
28 deletions
@@ -15,7 +15,7 @@ const sale = require(`${mRoot}/sale`); // sale 页 model | @@ -15,7 +15,7 @@ const sale = require(`${mRoot}/sale`); // sale 页 model | ||
15 | * @param {[type]} res [description] | 15 | * @param {[type]} res [description] |
16 | * @return {[type]} [description] | 16 | * @return {[type]} [description] |
17 | */ | 17 | */ |
18 | -exports.index = (req, res) => { | 18 | +exports.index = (req, res, next) => { |
19 | let channel = req.query.channel || req.cookies._Channel || 'boys'; | 19 | let channel = req.query.channel || req.cookies._Channel || 'boys'; |
20 | 20 | ||
21 | let responseData = { | 21 | let responseData = { |
@@ -29,10 +29,7 @@ exports.index = (req, res) => { | @@ -29,10 +29,7 @@ exports.index = (req, res) => { | ||
29 | responseData.resultShow = JSON.stringify(result, null, 4); | 29 | responseData.resultShow = JSON.stringify(result, null, 4); |
30 | responseData.headerData = result.headerData; | 30 | responseData.headerData = result.headerData; |
31 | res.render('sale/index', responseData); | 31 | res.render('sale/index', responseData); |
32 | - }).catch(() => { | ||
33 | - responseData.pageErr = true; | ||
34 | - res.render('error', responseData); | ||
35 | - }); | 32 | + }).catch(next); |
36 | 33 | ||
37 | }; | 34 | }; |
38 | 35 | ||
@@ -42,7 +39,7 @@ exports.index = (req, res) => { | @@ -42,7 +39,7 @@ exports.index = (req, res) => { | ||
42 | * @param {[type]} res [description] | 39 | * @param {[type]} res [description] |
43 | * @return {[type]} [description] | 40 | * @return {[type]} [description] |
44 | */ | 41 | */ |
45 | -exports.discount = (req, res) => { | 42 | +exports.discount = (req, res, next) => { |
46 | let params = Object.assign({ | 43 | let params = Object.assign({ |
47 | saleType: '3' | 44 | saleType: '3' |
48 | }, req.query); | 45 | }, req.query); |
@@ -59,12 +56,8 @@ exports.discount = (req, res) => { | @@ -59,12 +56,8 @@ exports.discount = (req, res) => { | ||
59 | responseData.resultShow = JSON.stringify(result, null, 4); | 56 | responseData.resultShow = JSON.stringify(result, null, 4); |
60 | responseData.headerData = result.headerData; | 57 | responseData.headerData = result.headerData; |
61 | 58 | ||
62 | - // log.info(result); | ||
63 | res.render('sale/discount', responseData); | 59 | res.render('sale/discount', responseData); |
64 | - }).catch(() => { | ||
65 | - responseData.pageErr = true; | ||
66 | - res.render('error', responseData); | ||
67 | - }); | 60 | + }).catch(next); |
68 | }; | 61 | }; |
69 | 62 | ||
70 | /** | 63 | /** |
@@ -73,7 +66,7 @@ exports.discount = (req, res) => { | @@ -73,7 +66,7 @@ exports.discount = (req, res) => { | ||
73 | * @param {[type]} res [description] | 66 | * @param {[type]} res [description] |
74 | * @return {[type]} [description] | 67 | * @return {[type]} [description] |
75 | */ | 68 | */ |
76 | -exports.vip = (req, res) => { | 69 | +exports.vip = (req, res, next) => { |
77 | let params = Object.assign({ | 70 | let params = Object.assign({ |
78 | saleType: '2' | 71 | saleType: '2' |
79 | }, req.query); | 72 | }, req.query); |
@@ -92,10 +85,7 @@ exports.vip = (req, res) => { | @@ -92,10 +85,7 @@ exports.vip = (req, res) => { | ||
92 | responseData.resultShow = JSON.stringify(result, null, 4); | 85 | responseData.resultShow = JSON.stringify(result, null, 4); |
93 | responseData.headerData = result.headerData; | 86 | responseData.headerData = result.headerData; |
94 | res.render('sale/other', responseData); | 87 | res.render('sale/other', responseData); |
95 | - }).catch(() => { | ||
96 | - responseData.pageErr = true; | ||
97 | - res.render('error', responseData); | ||
98 | - }); | 88 | + }).catch(next); |
99 | 89 | ||
100 | }; | 90 | }; |
101 | 91 | ||
@@ -105,7 +95,7 @@ exports.vip = (req, res) => { | @@ -105,7 +95,7 @@ exports.vip = (req, res) => { | ||
105 | * @param {[type]} res [description] | 95 | * @param {[type]} res [description] |
106 | * @return {[type]} [description] | 96 | * @return {[type]} [description] |
107 | */ | 97 | */ |
108 | -exports.newSale = (req, res) => { | 98 | +exports.newSale = (req, res, next) => { |
109 | let params = Object.assign({ | 99 | let params = Object.assign({ |
110 | order: 's_t_desc' | 100 | order: 's_t_desc' |
111 | }, req.query); | 101 | }, req.query); |
@@ -122,10 +112,7 @@ exports.newSale = (req, res) => { | @@ -122,10 +112,7 @@ exports.newSale = (req, res) => { | ||
122 | responseData.resultShow = JSON.stringify(result, null, 4); | 112 | responseData.resultShow = JSON.stringify(result, null, 4); |
123 | responseData.headerData = result.headerData; | 113 | responseData.headerData = result.headerData; |
124 | res.render('sale/other', responseData); | 114 | res.render('sale/other', responseData); |
125 | - }).catch(() => { | ||
126 | - responseData.pageErr = true; | ||
127 | - res.render('error', responseData); | ||
128 | - }); | 115 | + }).catch(next); |
129 | }; | 116 | }; |
130 | 117 | ||
131 | /** | 118 | /** |
@@ -134,7 +121,7 @@ exports.newSale = (req, res) => { | @@ -134,7 +121,7 @@ exports.newSale = (req, res) => { | ||
134 | * @param {[type]} res [description] | 121 | * @param {[type]} res [description] |
135 | * @return {[type]} [description] | 122 | * @return {[type]} [description] |
136 | */ | 123 | */ |
137 | -exports.breakingYards = (req, res) => { | 124 | +exports.breakingYards = (req, res, next) => { |
138 | let params = Object.assign({ | 125 | let params = Object.assign({ |
139 | saleType: '5' | 126 | saleType: '5' |
140 | }, req.query); | 127 | }, req.query); |
@@ -151,10 +138,7 @@ exports.breakingYards = (req, res) => { | @@ -151,10 +138,7 @@ exports.breakingYards = (req, res) => { | ||
151 | responseData.resultShow = JSON.stringify(result, null, 4); | 138 | responseData.resultShow = JSON.stringify(result, null, 4); |
152 | responseData.headerData = result.headerData; | 139 | responseData.headerData = result.headerData; |
153 | res.render('sale/other', responseData); | 140 | res.render('sale/other', responseData); |
154 | - }).catch(() => { | ||
155 | - responseData.pageErr = true; | ||
156 | - res.render('error', responseData); | ||
157 | - }); | 141 | + }).catch(next); |
158 | }; | 142 | }; |
159 | 143 | ||
160 | /** | 144 | /** |
@@ -163,7 +147,7 @@ exports.breakingYards = (req, res) => { | @@ -163,7 +147,7 @@ exports.breakingYards = (req, res) => { | ||
163 | * @param {[type]} res [description] | 147 | * @param {[type]} res [description] |
164 | * @return {[type]} [description] | 148 | * @return {[type]} [description] |
165 | */ | 149 | */ |
166 | -exports.getGoodsList = (req, res) => { | 150 | +exports.getGoodsList = (req, res, next) => { |
167 | let params = req.query; | 151 | let params = req.query; |
168 | 152 | ||
169 | params.uid = req.user.uid || 0; | 153 | params.uid = req.user.uid || 0; |
@@ -176,5 +160,5 @@ exports.getGoodsList = (req, res) => { | @@ -176,5 +160,5 @@ exports.getGoodsList = (req, res) => { | ||
176 | responseData.result = result; | 160 | responseData.result = result; |
177 | 161 | ||
178 | res.render('goods', responseData); | 162 | res.render('goods', responseData); |
179 | - }); | 163 | + }).catch(next); |
180 | }; | 164 | }; |
-
Please register or login to post a comment