fix bangumi

This commit is contained in:
shinya
2025-09-25 00:54:27 +08:00
parent 586ab2a058
commit c65ce8c55d
9 changed files with 41 additions and 15 deletions

View File

@@ -1,3 +1,10 @@
## [100.0.1] - 2025-09-25
### Fixed
- 修复错误的环境变量 ADMIN_USERNAME
- 修复 bangumi 数据中没有图片导致首页崩溃问题
## [100.0.0] - 2025-08-26
### Added

View File

@@ -1 +1 @@
100.0.0
100.0.1

View File

@@ -25,7 +25,7 @@ export async function GET(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -79,7 +79,7 @@ export async function POST(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -150,7 +150,7 @@ export async function DELETE(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username

View File

@@ -18,7 +18,7 @@ export async function GET(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -51,7 +51,7 @@ export async function POST(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -117,7 +117,7 @@ export async function DELETE(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username

View File

@@ -24,7 +24,7 @@ export async function GET(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -61,7 +61,7 @@ export async function POST(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -113,7 +113,7 @@ export async function DELETE(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username

View File

@@ -17,7 +17,7 @@ export async function GET(request: NextRequest) {
}
const config = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = config.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -60,7 +60,7 @@ export async function POST(request: NextRequest) {
}
const adminConfig = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = adminConfig.UserConfig.Users.find(
(u) => u.username === authInfo.username
@@ -113,7 +113,7 @@ export async function DELETE(request: NextRequest) {
}
const adminConfig = await getConfig();
if (authInfo.username !== process.env.ADMIN_USERNAME) {
if (authInfo.username !== process.env.USERNAME) {
// 非站长,检查用户存在或被封禁
const user = adminConfig.UserConfig.Users.find(
(u) => u.username === authInfo.username

View File

@@ -25,5 +25,10 @@ export interface BangumiCalendarData {
export async function GetBangumiCalendarData(): Promise<BangumiCalendarData[]> {
const response = await fetch('https://api.bgm.tv/calendar');
const data = await response.json();
return data;
const filteredData = data.map((item: BangumiCalendarData) => ({
...item,
items: item.items.filter(bangumiItem => bangumiItem.images)
}));
return filteredData;
}

View File

@@ -10,6 +10,20 @@ export interface ChangelogEntry {
}
export const changelog: ChangelogEntry[] = [
{
version: "100.0.1",
date: "2025-09-25",
added: [
// 无新增内容
],
changed: [
// 无变更内容
],
fixed: [
"修复错误的环境变量 ADMIN_USERNAME",
"修复 bangumi 数据中没有图片导致首页崩溃问题"
]
},
{
version: "100.0.0",
date: "2025-08-26",

View File

@@ -1,6 +1,6 @@
/* eslint-disable no-console */
const CURRENT_VERSION = '100.0.0';
const CURRENT_VERSION = '100.0.1';
// 导出当前版本号供其他地方使用
export { CURRENT_VERSION };