This commit is contained in:
DIYgod 2019-01-17 15:57:03 +08:00
parent d64ca7b724
commit 83a1e4a574
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
1 changed files with 2 additions and 2 deletions

View File

@ -2,12 +2,12 @@ const axios = require('../../utils/axios');
module.exports = async (ctx) => {
const seasonid = ctx.params.seasonid;
let response = await axios({
const response = await axios({
method: 'get',
url: `https://bangumi.bilibili.com/anime/${seasonid}`,
});
let data = JSON.parse(response.data.match(/window\.__INITIAL_STATE__=([\s\S]+);\(function\(\)/)[1]) || {};
const data = JSON.parse(response.data.match(/window\.__INITIAL_STATE__=([\s\S]+);\(function\(\)/)[1]) || {};
ctx.state.data = {
title: data.mediaInfo.chn_name,