fix(route): jpxgmn (#15118)
This commit is contained in:
parent
0e11352797
commit
860d7ad45f
|
|
@ -1,7 +1,7 @@
|
|||
import { Route } from '@/types';
|
||||
import { originUrl, getArticleDesc } from './utils';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import ofetch from '@/utils/ofetch';
|
||||
import { load } from 'cheerio';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
|
|
@ -18,9 +18,9 @@ export const route: Route = {
|
|||
async function handler(ctx) {
|
||||
const { kw } = ctx.req.param();
|
||||
const searchUrl = originUrl + `/plus/search/index.asp?keyword=${kw}`;
|
||||
const response = await got(searchUrl);
|
||||
const response = await ofetch.raw(searchUrl);
|
||||
const baseUrl = new URL(response.url).origin;
|
||||
const $ = load(response.data);
|
||||
const $ = load(response._data);
|
||||
const items = $('div.list div.list div.node p')
|
||||
.toArray()
|
||||
.map((item) => ({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Route } from '@/types';
|
||||
import { originUrl, getArticleDesc } from './utils';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import ofetch from '@/utils/ofetch';
|
||||
import { load } from 'cheerio';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
|
|
@ -25,9 +25,9 @@ async function handler(ctx) {
|
|||
const { tab = 'top' } = ctx.req.param();
|
||||
const isSpecial = ['new', 'top', 'hot'].includes(tab);
|
||||
const tabUrl = `${originUrl}/${tab}` + (isSpecial ? '.html' : '/');
|
||||
const response = await got(tabUrl);
|
||||
const response = await ofetch.raw(tabUrl);
|
||||
const baseUrl = new URL(response.url).origin;
|
||||
const $ = load(response.data);
|
||||
const $ = load(response._data);
|
||||
const topTitle = $('div.toptip > a').get(1);
|
||||
let feedTitle = $('title').text();
|
||||
if (isSpecial) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Route } from '@/types';
|
||||
import { originUrl, getArticleDesc } from './utils';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import ofetch from '@/utils/ofetch';
|
||||
import { load } from 'cheerio';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
|
|
@ -21,9 +21,9 @@ export const route: Route = {
|
|||
};
|
||||
|
||||
async function handler() {
|
||||
const response = await got(originUrl);
|
||||
const response = await ofetch.raw(originUrl);
|
||||
const baseUrl = new URL(response.url).origin;
|
||||
const $ = load(response.data);
|
||||
const $ = load(response._data);
|
||||
const items = $('aside div:nth-child(2) li')
|
||||
.toArray()
|
||||
.map((item) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue