fix(route/copymanga): fix comic (#19401)
This commit is contained in:
parent
58793f4fc7
commit
39e1f779a1
|
|
@ -2,7 +2,7 @@ import { Route } from '@/types';
|
|||
|
||||
import cache from '@/utils/cache';
|
||||
import { load } from 'cheerio';
|
||||
import got from '@/utils/got';
|
||||
import ofetch from '@/utils/ofetch';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
import { art } from '@/utils/render';
|
||||
import path from 'node:path';
|
||||
|
|
@ -48,11 +48,11 @@ async function handler(ctx) {
|
|||
do {
|
||||
bHasNextPage = false;
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const { data } = await got(strBaseUrl, {
|
||||
const data = await ofetch(strBaseUrl, {
|
||||
headers: {
|
||||
platform: 1,
|
||||
platform: '',
|
||||
},
|
||||
searchParams: {
|
||||
query: {
|
||||
limit: iReqLimit,
|
||||
offset: iReqOffSet,
|
||||
},
|
||||
|
|
@ -92,7 +92,7 @@ async function handler(ctx) {
|
|||
|
||||
// 获取漫画标题、介绍
|
||||
const { bookTitle, bookIntro } = await cache.tryGet(`${baseUrl}/comic/${id}`, async () => {
|
||||
const { data } = await got(`${baseUrl}/comic/${id}`);
|
||||
const data = await ofetch(`${baseUrl}/comic/${id}`);
|
||||
const $ = load(data);
|
||||
return {
|
||||
bookTitle: $('.comicParticulars-title-right > ul > li > h6').text(),
|
||||
|
|
@ -101,11 +101,9 @@ async function handler(ctx) {
|
|||
});
|
||||
|
||||
const genResult = async (chapter) => {
|
||||
const {
|
||||
data: { code, results },
|
||||
} = await got(`${apiBaseUrl}/api/v3/comic/${id}/chapter/${chapter.uuid}`, {
|
||||
const { code, results } = await ofetch(`${apiBaseUrl}/api/v3/comic/${id}/chapter/${chapter.uuid}`, {
|
||||
headers: {
|
||||
webp: 1,
|
||||
webp: '1',
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue