网络直播增加开关

This commit is contained in:
mtvpls
2026-01-21 00:16:42 +08:00
parent 77ee98aee4
commit 5c08304b6d
8 changed files with 177 additions and 8 deletions

View File

@@ -27,6 +27,12 @@ export async function POST(request: NextRequest) {
}
switch (action) {
case 'toggleEnabled': {
const { enabled } = body;
config.WebLiveEnabled = enabled;
break;
}
case 'add': {
const { name, platform, roomId } = body;
if (!name || !platform || !roomId) {

View File

@@ -1,6 +1,8 @@
import { NextRequest, NextResponse } from 'next/server';
import { getConfig } from '@/lib/config';
export const dynamic = 'force-dynamic'; // 禁用缓存
export async function GET(request: NextRequest) {
try {
const config = await getConfig();