删除完善

This commit is contained in:
pplokijuhyg 2019-12-10 14:56:00 +08:00
parent 517828df04
commit 5771c6e423

View File

@ -38,13 +38,21 @@ var getaddlist = async (ctx,next) =>{
next() next()
} }
var dellist = async (ctx,next)=>{ var dellist = async (ctx,next)=>{
await dbs.remove('list',{ if(ctx.query.id == undefined){
"num_key":ctx.query.id ctx.body = JSON.stringify({
}).then((res)=>{ code : 1,
ctx.body = JSON.stringify(res) msg:"id不能为空"
}).catch((err)=>{ })
ctx.body = JSON.stringify(res) }else{
}) await dbs.remove('list',{
"num_key":ctx.query.id
}).then((res)=>{
ctx.body = JSON.stringify(res)
}).catch((err)=>{
ctx.body = JSON.stringify(res)
})
}
} }
module.exports = { module.exports = {
'GET /getlist':getlist, 'GET /getlist':getlist,