删除完善

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()
}
var dellist = async (ctx,next)=>{
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)=>{
@ -45,6 +51,8 @@ var dellist = async (ctx,next)=>{
}).catch((err)=>{
ctx.body = JSON.stringify(res)
})
}
}
module.exports = {
'GET /getlist':getlist,