This commit is contained in:
pplokijuhyg 2019-12-23 20:40:05 +08:00
parent 5cd2a56c8c
commit 6c2ea87030

View File

@ -53,12 +53,29 @@ var dellist = async (ctx,next)=>{
ctx.body = JSON.stringify(res) ctx.body = JSON.stringify(res)
}) })
} }
}
var findlist = async (ctx,next)=>{
// console.log(ctx.query.id)
if(ctx.query.name == undefined){
ctx.body = JSON.stringify({
code : 1,
msg:"id不能为空"
})
}else{
await dbs.find('list',{
"name":ctx.query.name
}).then((res)=>{
ctx.body = JSON.stringify(res)
}).catch((err)=>{
ctx.body = JSON.stringify(res)
})
}
} }
module.exports = { module.exports = {
'GET /getlist':getlist, 'GET /getlist':getlist,
'POST /addlist':addlist, 'POST /addlist':addlist,
'GET /getaddlist':getaddlist, 'GET /getaddlist':getaddlist,
'GET /dellist' : dellist 'GET /dellist' : dellist,
'GET /findlsit':findlist
} }