呃呃呃

This commit is contained in:
2025-04-12 10:54:26 +08:00
parent 4dfe3cef7f
commit 1e678ad6b6
17 changed files with 221 additions and 288 deletions

View File

@@ -22,7 +22,7 @@ const _ = require("../import");
* @apiVersion 1.0.0
*/
_.router.post('/addCar', async function(req, res, next) {
var shopid = req.headers.data.waresid;
var shopid = req.body.waresid;
var IsAddShopCar = await _.db.query({
sql: _.config.sql.selectCarShop,
@@ -115,9 +115,9 @@ _.router.post('/getCarList', async function(req, res, next) {
* @apiVersion 1.0.0
*/
_.router.post('/checkCar', async function(req, res, next) {
var shopid = req.headers.data.waresid;
var shopid = req.body.waresid;
console.log("req.headers.data: ", req.headers.data);
console.log("req.body: ", req.body);
var IsAddShopCar = await _.db.query({
sql: _.config.sql.selectCarShop,
@@ -169,7 +169,7 @@ _.router.post('/checkCar', async function(req, res, next) {
* @apiVersion 1.0.0
*/
_.router.post('/deleteCar', async function(req, res, next) {
var carid = req.headers.data.carid;
var carid = req.body.carid;
carid.forEach(async function(val) {
var deleteCar = await _.db.query({
sql: _.config.sql.deleteCarShop,
@@ -208,8 +208,8 @@ _.router.post('/deleteCar', async function(req, res, next) {
* @apiVersion 1.0.0
*/
_.router.post('/updateCarNum', async function(req, res, next) {
var carid = req.headers.data.carid;
var quantity = req.headers.data.quantity;
var carid = req.body.carid;
var quantity = req.body.quantity;
var updateCarNum = await _.db.query({
sql: _.config.sql.updateCarNum,
@@ -259,7 +259,7 @@ _.router.post('/updateCarNum', async function(req, res, next) {
*/
_.router.post('/submitCar', async function(req, res, next) {
//"{"carList":[{"waresid":113,"goodsnum":2,"goodsprice":1000},{"waresid":114,"goodsnum":1,"goodsprice":1100}]}"
var carList = JSON.parse(req.headers.data).carList;
var carList = JSON.parse(req.body).carList;
carList.forEach(async function(val) {
val.user_id = _.jwt.decode(req.headers.token).id;

View File

@@ -155,7 +155,7 @@ _.router.post('/recommend', async function (req, res, next) {
* @apiVersion 1.0.0
*/
_.router.post('/info', async function (req, res, next) {
var id = req.headers.data.id;
var id = req.body.id;
var data = (await _.db.query({
sql: _.config.sql.getInfo,
@@ -192,7 +192,7 @@ _.router.post('/info', async function (req, res, next) {
* @apiVersion 1.0.0
*/
_.router.post('/activity', async function (req, res, next) {
var activity_id = req.headers.data.id;
var activity_id = req.body.id;
var data = await _.db.query({
sql: _.config.sql.getActivity,
@@ -229,7 +229,7 @@ _.router.post('/activity', async function (req, res, next) {
* @apiVersion 1.0.0
*/
_.router.post('/search', async function (req, res, next) {
var keyword = req.headers.data.keyword;
var keyword = req.body.keyword;
console.log("keyword ", keyword)
var data = await _.db.query({

View File

@@ -24,7 +24,7 @@ const _ = require("../import");
*/
_.router.post('/allOrder', async function(req, res, next) {
var status = req.headers.data.status, sql = null, params = [];
var status = req.body.status, sql = null, params = [];
if (status == -1) {
sql = _.config.sql.getAllOrder
@@ -81,7 +81,7 @@ _.router.post('/allOrder', async function(req, res, next) {
*/
_.router.post('/buyOrder', async function(req, res, next) {
var goods_id = JSON.parse(req.headers.data.goodsid);
var goods_id = JSON.parse(req.body.goodsid);
goods_id.forEach(async function(val) {
var buyOrder = await _.db.query({

View File

@@ -22,7 +22,7 @@ const _ = require("../import");
* @apiVersion 1.0.0
*/
_.router.post('/list', async function(req, res, next) {
var typename = req.headers.data.typename;
var typename = req.body.typename;
var data = await _.db.query({
sql: _.config.sql.getTypeList,

View File

@@ -27,8 +27,8 @@ const _ = require("../import");
*/
_.router.post('/login', async function (req, res, next) {
var username = req.headers.data.name,
userpwd = req.headers.data.pwd;
var username = req.body.name,
userpwd = req.body.pwd;
console.log("username: ", username);
console.log("userpwd: ", userpwd);
@@ -86,9 +86,9 @@ _.router.post('/login', async function (req, res, next) {
*/
_.router.post('/add', async function (req, res, next) {
var username = req.headers.data.name,
userpwd = req.headers.data.pwd,
userphone = req.headers.data.phone;
var username = req.body.name,
userpwd = req.body.pwd,
userphone = req.body.phone;
var data = await _.db.query({
sql: _.config.sql.addUser,
@@ -135,7 +135,7 @@ _.router.post('/add', async function (req, res, next) {
*/
_.router.post('/like', async function (req, res, next) {
var like_shop = req.headers.data.shopid;
var like_shop = req.body.shopid;
var IsLike = await _.db.query({
sql: _.config.sql.selectLike,
data: [like_shop,_.jwt.decode(req.headers.token).id]