用户组增加权限控制

This commit is contained in:
mtvpls
2026-04-22 16:22:17 +08:00
parent 2734de0c85
commit 0916e4ff08
61 changed files with 617 additions and 165 deletions
+4 -1
View File
@@ -3,10 +3,13 @@
import { NextRequest, NextResponse } from 'next/server';
import { getConfig } from '@/lib/config';
import { requireFeaturePermission } from '@/lib/permissions';
export const runtime = 'nodejs';
export async function GET(request: NextRequest) {
const authResult = await requireFeaturePermission(request, 'live', '无权限访问电视直播');
if (authResult instanceof NextResponse) return authResult;
const { searchParams } = new URL(request.url);
const url = searchParams.get('url');
const source = searchParams.get('moontv-source');
@@ -51,4 +54,4 @@ export async function GET(request: NextRequest) {
} catch (error) {
return NextResponse.json({ error: 'Failed to fetch', message: error }, { status: 500 });
}
}
}