fix(route/ff14): 修复部分「公告」条目缺失的问题 (#21261)

* fix(route/ff14): 追加「公告」类型编码

* style(ff14): rename type_number to typeNumber for camelCase consistency
This commit is contained in:
karasu 2026-03-02 13:21:57 +08:00 committed by GitHub
parent c205eeb107
commit a1d266888c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -37,17 +37,18 @@ async function handler(ctx) {
const referer = 'https://ff.sdo.com/web8/index.html';
const type = ctx.req.param('type') ?? 'all';
const type_number = {
const typeNumber: Record<string, string> = {
news: '5310',
announce: '5312',
announce: '5312,8324,8325,8326,8327',
events: '5311',
advertise: '5313',
all: '5310,5312,5311,5313,5309',
};
typeNumber.all = `5309,${Object.values(typeNumber).join(',')}`;
const response = await got({
method: 'get',
url: `http://api.act.sdo.com/UnionNews/List?gameCode=ff&category=${type_number[type]}&pageIndex=0&pageSize=50`,
url: `http://api.act.sdo.com/UnionNews/List?gameCode=ff&category=${typeNumber[type]}&pageIndex=0&pageSize=50`,
headers: {
Referer: referer,
},