用户组增加权限控制

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
+9 -4
View File
@@ -72,14 +72,22 @@ interface LiveSource {
}
function LivePageClient() {
const router = useRouter();
const searchParams = useSearchParams();
// 动态加载浏览器专用库
useEffect(() => {
if (typeof window !== 'undefined') {
import('artplayer').then(mod => { Artplayer = mod.default; });
import('hls.js').then(mod => { Hls = mod.default; });
import('flv.js').then(mod => { flvjs = mod.default; });
const runtimeConfig = (window as any).RUNTIME_CONFIG;
if (runtimeConfig?.LIVE_ENABLED === false) {
router.replace('/');
}
}
}, []);
}, [router]);
// -----------------------------------------------------------------------------
// 状态变量(State
@@ -91,9 +99,6 @@ function LivePageClient() {
const [loadingMessage, setLoadingMessage] = useState('正在加载直播源...');
const [error, setError] = useState<string | null>(null);
const searchParams = useSearchParams();
const router = useRouter();
// 直播源相关
const [liveSources, setLiveSources] = useState<LiveSource[]>([]);
const [currentSource, setCurrentSource] = useState<LiveSource | null>(null);