删除完善

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

View File

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