用户组增加权限控制
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user