删除字段

This commit is contained in:
theluyuan 2021-09-08 14:46:03 +08:00
parent 3fc2d12c10
commit 8765de91b3

View File

@ -16,7 +16,7 @@ let addshop = async (ctx,next)=>{
// } // }
// JSON.stringify(a) // JSON.stringify(a)
// console.log(ctx.request.body) // console.log(ctx.request.body)
let { mingcheng, fenlei, maidian, jiage, huodongjia, kucun, shangjia ,xiangqing } = ctx.request.body let { mingcheng, fenlei, maidian, jiage} = ctx.request.body
if(mingcheng == undefined){ if(mingcheng == undefined){
ctx.body = JSON.stringify({ ctx.body = JSON.stringify({
code: 1, code: 1,
@ -38,35 +38,16 @@ let addshop = async (ctx,next)=>{
}) })
return ; return ;
} }
if(huodongjia == undefined){ if(fenlei == undefined){
ctx.body = JSON.stringify({ ctx.body = JSON.stringify({
code: 1, code: 1,
msg: "活动价格不能为空" msg: "分类不能为空"
})
return ;
}
if(kucun == undefined){
ctx.body = JSON.stringify({
code: 1,
msg: "库存不能为空"
})
return ;
}
if(shangjia == undefined){
ctx.body = JSON.stringify({
code: 1,
msg: "是否上架不能为空"
})
return ;
}
if(xiangqing == undefined){
ctx.body = JSON.stringify({
code: 1,
msg: "商品详情不能为空"
}) })
return ; return ;
} }
ctx.body = await dbs.add("shop", ctx.request.body) ctx.body = await dbs.add("shop", ctx.request.body)
// ctx.body="添加" // ctx.body="添加"