文章添加带注释
This commit is contained in:
parent
2730de72cb
commit
178bb9fc71
@ -9,6 +9,7 @@ var articlefind = async (ctx, next) => {
|
|||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
// 添加文章
|
// 添加文章
|
||||||
|
// 参数: title 文章标题, content 文章内容 tag 选择的标签id 形式: 1,2
|
||||||
var articleadd = async (ctx, next) => {
|
var articleadd = async (ctx, next) => {
|
||||||
let articleid=0
|
let articleid=0
|
||||||
let month=parseInt(new Date(Date.now()).getMonth())+1
|
let month=parseInt(new Date(Date.now()).getMonth())+1
|
||||||
@ -38,18 +39,6 @@ var articleadd = async (ctx, next) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(res.data.length)
|
|
||||||
// console.log(res.data[res.data.length-1].num_key)
|
|
||||||
// let tags=ctx.request.body.tags.split(",")
|
|
||||||
// console.log(ctx.request.body.tags.split(","))
|
|
||||||
// for(let i in ctx.request.body.tags.split(",")){
|
|
||||||
// // console.log(ctx.request.body.tags.split(",")[i])
|
|
||||||
// await dbs.add("articletag",{articleid:res.data[res.data.length-1].num_key,tagid:ctx.request.body.tags.split(",")[i]})
|
|
||||||
// console.log("success")
|
|
||||||
|
|
||||||
// }
|
|
||||||
// await dbs.add("articletag",{articleid:res.data[res.data.length-1].num_key,tagid:ctx.query.tagid})
|
|
||||||
})
|
})
|
||||||
console.log(ctx.request.body)
|
console.log(ctx.request.body)
|
||||||
ctx.body = "添加成功"
|
ctx.body = "添加成功"
|
||||||
|
Loading…
Reference in New Issue
Block a user