mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-28 09:23:14 +08:00
/api/search/resources add user check
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
## [100.0.2] - 2025-10-23
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 修复 /api/search/resources 接口越权问题
|
||||||
|
|
||||||
## [100.0.1] - 2025-09-25
|
## [100.0.1] - 2025-09-25
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
100.0.1
|
100.0.2
|
||||||
@@ -1,16 +1,19 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
import { NextRequest, NextResponse } from 'next/server';
|
import { NextRequest, NextResponse } from 'next/server';
|
||||||
|
import { getAuthInfoFromCookie } from '@/lib/auth';
|
||||||
import { getAvailableApiSites } from '@/lib/config';
|
import { getAvailableApiSites } from '@/lib/config';
|
||||||
|
|
||||||
export const runtime = 'nodejs';
|
export const runtime = 'nodejs';
|
||||||
|
|
||||||
// OrionTV 兼容接口
|
// OrionTV 兼容接口
|
||||||
export async function GET(request: NextRequest) {
|
export async function GET(request: NextRequest) {
|
||||||
console.log('request', request.url);
|
const authInfo = getAuthInfoFromCookie(request);
|
||||||
|
if (!authInfo || !authInfo.username) {
|
||||||
|
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const apiSites = await getAvailableApiSites();
|
const apiSites = await getAvailableApiSites(authInfo.username);
|
||||||
|
|
||||||
return NextResponse.json(apiSites);
|
return NextResponse.json(apiSites);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -10,6 +10,19 @@ export interface ChangelogEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const changelog: ChangelogEntry[] = [
|
export const changelog: ChangelogEntry[] = [
|
||||||
|
{
|
||||||
|
version: "100.0.2",
|
||||||
|
date: "2025-10-23",
|
||||||
|
added: [
|
||||||
|
// 无新增内容
|
||||||
|
],
|
||||||
|
changed: [
|
||||||
|
// 无变更内容
|
||||||
|
],
|
||||||
|
fixed: [
|
||||||
|
"修复 /api/search/resources 接口越权问题"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
version: "100.0.1",
|
version: "100.0.1",
|
||||||
date: "2025-09-25",
|
date: "2025-09-25",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
const CURRENT_VERSION = '100.0.1';
|
const CURRENT_VERSION = '100.0.2';
|
||||||
|
|
||||||
// 导出当前版本号供其他地方使用
|
// 导出当前版本号供其他地方使用
|
||||||
export { CURRENT_VERSION };
|
export { CURRENT_VERSION };
|
||||||
|
|||||||
Reference in New Issue
Block a user