fix(route): customs (#17204)
* fix(route): customs * docs: add back warning
This commit is contained in:
@@ -31,8 +31,8 @@ export const route: Route = {
|
||||
handler,
|
||||
url: 'www.customs.gov.cn/',
|
||||
description: `:::warning
|
||||
由于区域限制,建议在国内 IP 的机器上自建
|
||||
:::`,
|
||||
由于区域限制,建议在国内 IP 的机器上自建
|
||||
:::`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
@@ -81,6 +81,9 @@ async function handler(ctx) {
|
||||
const out = await Promise.all(
|
||||
list.map((info) =>
|
||||
cache.tryGet(info.link, async () => {
|
||||
if (info.link.endsWith('.pdf') || info.link.endsWith('.doc')) {
|
||||
return info;
|
||||
}
|
||||
const response = await puppeteerGet(info.link, browser);
|
||||
const $ = load(response);
|
||||
let date;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '中华人民共和国海关总署',
|
||||
url: 'www.customs.gov.cn',
|
||||
categories: ['government'],
|
||||
};
|
||||
Reference in New Issue
Block a user