删除字段
This commit is contained in:
parent
3fc2d12c10
commit
8765de91b3
@ -16,7 +16,7 @@ let addshop = async (ctx,next)=>{
|
||||
// }
|
||||
// JSON.stringify(a)
|
||||
// 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){
|
||||
ctx.body = JSON.stringify({
|
||||
code: 1,
|
||||
@ -38,34 +38,15 @@ let addshop = async (ctx,next)=>{
|
||||
})
|
||||
return ;
|
||||
}
|
||||
if(huodongjia == undefined){
|
||||
if(fenlei == undefined){
|
||||
ctx.body = JSON.stringify({
|
||||
code: 1,
|
||||
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: "商品详情不能为空"
|
||||
msg: "分类不能为空"
|
||||
})
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ctx.body = await dbs.add("shop", ctx.request.body)
|
||||
// ctx.body="添加"
|
||||
|
Loading…
Reference in New Issue
Block a user