extra.js 952 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import Router from 'koa-router'
  2. import axios from 'axios'
  3. import { topbg, hot, slideshow, season, recommend } from './urlConfig.js'
  4. const router = Router()
  5. // 顶部背景图
  6. router.get('/topbg', async (ctx, next) => {
  7. const response = await axios.get(topbg)
  8. ctx.body = response.data
  9. })
  10. // 各分类热门
  11. router.get('/hot', async (ctx, next) => {
  12. const response = await axios.get(hot)
  13. ctx.body = response.data
  14. })
  15. // 番剧下方更新列表右侧新番放送表上侧
  16. router.get('/slideshow', async (ctx, next) => {
  17. const response = await axios.get(slideshow)
  18. ctx.body = response.data
  19. })
  20. // 番剧下方更新列表右侧新番放送表下侧
  21. router.get('/season', async (ctx, next) => {
  22. const response = await axios.get(season)
  23. ctx.body = response.data
  24. })
  25. // 最底部特别推荐
  26. router.get('/recommend', async (ctx, next) => {
  27. const response = await axios.get(recommend)
  28. ctx.body = response.data
  29. })
  30. export default router