文章添加带注释 #30

Manually merged
asd merged 1 commits from zj into master 2019-12-05 11:00:12 +08:00
Showing only changes of commit 178bb9fc71 - Show all commits

View File

@ -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 = "添加成功"