extra.js 1.1 KB

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