fix(route/copymanga): fix comic (#19401)

This commit is contained in:
Tony 2025-06-18 07:48:08 +08:00 committed by GitHub
parent 58793f4fc7
commit 39e1f779a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 9 deletions

View File

@ -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',
},
});