1.
router.post('/form',async(ctx,next)=>{
const form = ctx.request.body;
console.log('用户名:'+form.userName+'----'+'密码:'+form.password);
ctx.body = {
resultCode:200
}
});
2.
ctx.response.body='ok'
3.
var arr = [1,3,4,5,6]
router.get('/',async (ctx, next) => {
//console.log('接受到的参数为:'+ctx.request.query.user);
const body = ctx.request.query;
console.log(body.user+'----'+body.age+'----'+body.body)
console.log('arr类型:'+ Array.isArray(arr))
//ctx.redirect('http://www.baidu.com')
await ctx.render('index', {
title:arr //'Hello Koa 22222222222222222!'
})