删除完善

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()
}
var dellist = async (ctx,next)=>{
await dbs.remove('list',{
"num_key":ctx.query.id
}).then((res)=>{
ctx.body = JSON.stringify(res)
}).catch((err)=>{
ctx.body = JSON.stringify(res)
})
if(ctx.query.id == undefined){
ctx.body = JSON.stringify({
code : 1,
msg:"id不能为空"
})
}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 = {
'GET /getlist':getlist,