一、渲染(传递数组)
view —>.html
{{each playlists}}
<p>
<a href="/detail?id={{$value.id}}">{{$value.name}}</a>
</p>
{{/each}}
http请求
index.js
router.get("/detail", async ctx=>{
var id=ctx.query.id;
// console.log(id)
console.log(ctx.query.id)
var url="https://music.aityp.com/playlist/detail?id="+id;
var res=await axios.get(url);
// console.log(res.data);
await ctx.render('detail')
})