diff --git a/controllers/article.js b/controllers/article.js index 1376c66..30fa713 100644 --- a/controllers/article.js +++ b/controllers/article.js @@ -9,6 +9,7 @@ var articlefind = async (ctx, next) => { next() } // 添加文章 +// 参数: title 文章标题, content 文章内容 tag 选择的标签id 形式: 1,2 var articleadd = async (ctx, next) => { let articleid=0 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) ctx.body = "添加成功"