用户组增加权限控制
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { requireFeaturePermission } from '@/lib/permissions';
|
||||
|
||||
function getBaseUrl(url: string): string {
|
||||
const urlObj = new URL(url);
|
||||
const pathParts = urlObj.pathname.split('/');
|
||||
@@ -38,6 +40,8 @@ function processM3u8Content(content: string, baseUrl: string): string {
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
const authResult = await requireFeaturePermission(request, 'web_live', '无权限访问网络直播');
|
||||
if (authResult instanceof NextResponse) return authResult;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const url = searchParams.get('url');
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { getConfig } from '@/lib/config';
|
||||
import { requireFeaturePermission } from '@/lib/permissions';
|
||||
|
||||
export const dynamic = 'force-dynamic'; // 禁用缓存
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
const authResult = await requireFeaturePermission(request, 'web_live', '无权限访问网络直播');
|
||||
if (authResult instanceof NextResponse) return authResult;
|
||||
const config = await getConfig();
|
||||
if (!config?.WebLiveConfig) {
|
||||
return NextResponse.json([]);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import crypto from 'crypto';
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { requireFeaturePermission } from '@/lib/permissions';
|
||||
|
||||
function getAntiCode(oldAntiCode: string, streamName: string): string {
|
||||
const paramsT = 100;
|
||||
const sdkVersion = 2403051612;
|
||||
@@ -206,6 +208,8 @@ async function getDouyinStream(roomId: string) {
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
const authResult = await requireFeaturePermission(request, 'web_live', '无权限访问网络直播');
|
||||
if (authResult instanceof NextResponse) return authResult;
|
||||
const { searchParams } = new URL(request.url);
|
||||
const platform = searchParams.get('platform');
|
||||
const roomId = searchParams.get('roomId');
|
||||
|
||||
Reference in New Issue
Block a user