|
@@ -12,12 +12,9 @@ router.get('/:id', async (ctx) => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
router.post('/', async (ctx) => {
|
|
router.post('/', async (ctx) => {
|
|
|
- // console.log(ctx.request.body)
|
|
|
|
|
- // ctx.body = ctx.request.body
|
|
|
|
|
console.log(ctx.request.body);
|
|
console.log(ctx.request.body);
|
|
|
article = ctx.request.body
|
|
article = ctx.request.body
|
|
|
article['authorID'] = 1
|
|
article['authorID'] = 1
|
|
|
- article['description'] = '当然也是一个测试'
|
|
|
|
|
result = await ArticleDao.insert(article)
|
|
result = await ArticleDao.insert(article)
|
|
|
console.log(result);
|
|
console.log(result);
|
|
|
ctx.body = result
|
|
ctx.body = result
|