Authored by htoooth

change params to query

@@ -53,7 +53,7 @@ module.exports.showMain = (req, res, next) => { @@ -53,7 +53,7 @@ module.exports.showMain = (req, res, next) => {
53 * 获取热区图 53 * 获取热区图
54 */ 54 */
55 module.exports.indexHotArea = (req, res, next) => { 55 module.exports.indexHotArea = (req, res, next) => {
56 - let pid = req.params.productId || 0; 56 + let pid = req.query.productId || 0;
57 57
58 service.indexHotAreaAsync(pid).then(result => { 58 service.indexHotAreaAsync(pid).then(result => {
59 res.render('product/hotarea', { 59 res.render('product/hotarea', {
@@ -68,11 +68,11 @@ module.exports.indexHotArea = (req, res, next) => { @@ -68,11 +68,11 @@ module.exports.indexHotArea = (req, res, next) => {
68 * json 68 * json
69 */ 69 */
70 module.exports.indexComment = (req, res, next) => { 70 module.exports.indexComment = (req, res, next) => {
71 - let pid = req.params.productId || 0; 71 + let pid = req.query.productId || 0;
72 72
73 - let page = req.params.page || 1; 73 + let page = req.query.page || 1;
74 74
75 - let size = req.params.size || 10; 75 + let size = req.query.size || 10;
76 76
77 service.indexCommentAsync(pid, page, size).then(result => { 77 service.indexCommentAsync(pid, page, size).then(result => {
78 res.json(result); 78 res.json(result);
@@ -86,11 +86,11 @@ module.exports.indexComment = (req, res, next) => { @@ -86,11 +86,11 @@ module.exports.indexComment = (req, res, next) => {
86 module.exports.indexConsult = (req, res, next) => { 86 module.exports.indexConsult = (req, res, next) => {
87 let uid = req.user.uid || ''; 87 let uid = req.user.uid || '';
88 88
89 - let pid = req.params.productId || 0; 89 + let pid = req.query.productId || 0;
90 90
91 - let page = req.params.page || 1; 91 + let page = req.query.page || 1;
92 92
93 - let size = req.params.size || 10; 93 + let size = req.query.size || 10;
94 94
95 service.indexConsultAsync(uid, pid, page, size).then(result => { 95 service.indexConsultAsync(uid, pid, page, size).then(result => {
96 res.json(result); 96 res.json(result);