Authored by htoooth

change params to query

... ... @@ -53,7 +53,7 @@ module.exports.showMain = (req, res, next) => {
* 获取热区图
*/
module.exports.indexHotArea = (req, res, next) => {
let pid = req.params.productId || 0;
let pid = req.query.productId || 0;
service.indexHotAreaAsync(pid).then(result => {
res.render('product/hotarea', {
... ... @@ -68,11 +68,11 @@ module.exports.indexHotArea = (req, res, next) => {
* json
*/
module.exports.indexComment = (req, res, next) => {
let pid = req.params.productId || 0;
let pid = req.query.productId || 0;
let page = req.params.page || 1;
let page = req.query.page || 1;
let size = req.params.size || 10;
let size = req.query.size || 10;
service.indexCommentAsync(pid, page, size).then(result => {
res.json(result);
... ... @@ -86,11 +86,11 @@ module.exports.indexComment = (req, res, next) => {
module.exports.indexConsult = (req, res, next) => {
let uid = req.user.uid || '';
let pid = req.params.productId || 0;
let pid = req.query.productId || 0;
let page = req.params.page || 1;
let page = req.query.page || 1;
let size = req.params.size || 10;
let size = req.query.size || 10;
service.indexConsultAsync(uid, pid, page, size).then(result => {
res.json(result);
... ...