Merge branch 'master' of http://git.luyuan.tk/pplokijuhyg/wecat-serve-demo
This commit is contained in:
@@ -41,6 +41,7 @@ var getaddlist = async (ctx,next) =>{
|
||||
next()
|
||||
}
|
||||
var dellist = async (ctx,next)=>{
|
||||
console.log(ctx.query.id)
|
||||
if(ctx.query.id == undefined){
|
||||
ctx.body = JSON.stringify({
|
||||
code : 1,
|
||||
@@ -48,20 +49,37 @@ var dellist = async (ctx,next)=>{
|
||||
})
|
||||
}else{
|
||||
await dbs.remove('list',{
|
||||
"num_key":ctx.query.id
|
||||
"num_key":parseInt(ctx.query.id)
|
||||
}).then((res)=>{
|
||||
ctx.body = JSON.stringify(res)
|
||||
}).catch((err)=>{
|
||||
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 = {
|
||||
'GET /getlist':getlist,
|
||||
'POST /addlist':addlist,
|
||||
'GET /getaddlist':getaddlist,
|
||||
'GET /dellist' : dellist,
|
||||
'GET /getdata' :getimg
|
||||
'GET /getdata' :getimg,
|
||||
'GET /findlsit':findlist
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user