fix(route): 修复 全国气象预警 为空的问题 (#15078)

This commit is contained in:
CaoMeiYouRen 2024-04-03 12:03:32 +08:00 committed by GitHub
parent a392f0f8df
commit b93dfabe1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -31,7 +31,7 @@ export const route: Route = {
};
async function handler(ctx) {
const { province } = ctx.req.param();
const { province = '' } = ctx.req.param();
const alarmInfoURL = `http://www.nmc.cn/rest/findAlarm`;
const { data: response } = await got(alarmInfoURL, {
searchParams: {
@ -42,7 +42,6 @@ async function handler(ctx) {
province,
},
});
const list = response.data.page.list.map((item) => ({
title: item.title,
link: `http://www.nmc.cn${item.url}`,