var priceChecked=req.query.priceChecked;console.log(priceChecked)//这里是1 var params={}if(priceChecked!='all'){ switch (priceChecked){ case '0':priceGt = 0;priceLte=100;break; case '1':priceGt = 100;priceLte=500;break; case '2':priceGt = 500;priceLte=1000;break; case '3':priceGt = 1000;priceLte=5000;break; } params = { salePrice:{ $gt:priceGt, $lte:priceLte } }console.log(params)//为什么这里是空}switch为什么不走case,switch (“1”)就走case1,但是获取到的1就是字符串1请求地址GET /goods?page=1&pageSize=8&sort=1&priceChecked=1;
添加回答
举报
0/150
提交
取消