Initial commit: LiveStream Platform
Backend: FastAPI + SQLAlchemy + SQLite Frontend: React + Vite + Ant Design (serif Anthropic theme) Media server: MediaMTX with edge node support Load balancing: round-robin / weighted / least-conn Multicast detection with automatic fallback Transcoding support via FFmpeg (configurable quality) hls.js player with line & quality switching Admin panel with password auth Windows compatible scripts
This commit is contained in:
commit
2e4594fa77
43 files changed
+2196
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import api, { setToken, getToken } from './client'
|
||||
|
||||
export async function login(password: string): Promise<string> {
|
||||
const { data } = await api.post(`/auth/login?password=${encodeURIComponent(password)}`)
|
||||
setToken(data.token)
|
||||
return data.token
|
||||
}
|
||||
|
||||
export async function verifyToken(): Promise<boolean> {
|
||||
const token = getToken()
|
||||
if (!token) return false
|
||||
try {
|
||||
await api.post(`/auth/verify?token=${encodeURIComponent(token)}`)
|
||||
return true
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user