全局整改: 布局重构、鉴权加固、API修复

- 首页/播放页: 去掉 antd Layout 改用 div 避免 flex 布局问题
- 播放页: 返回按钮改为 navigate('/') 替代 window.close()
- 后端登录/验证: 改用 POST JSON body 替代 query param
- 后端鉴权: require_auth 依赖注入保护所有管理接口
- nodes路由: 修复 /strategy 被 /{node_id} 拦截的顺序问题
- 前端 Settings: 策略更新改为 JSON body
This commit is contained in:
admin committed 2026-08-07 21:22:52 +08:00
1 parent f3b2a9cb46
commit b81a7bf293
7 files changed
+110 -64

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
import api, { setToken, getToken } from './client'
export async function login(password: string): Promise<string> {
const { data } = await api.post(`/auth/login?password=${encodeURIComponent(password)}`)
const { data } = await api.post('/auth/login', { password })
setToken(data.token)
return data.token
}
@@ -10,7 +10,7 @@ export async function verifyToken(): Promise<boolean> {
const token = getToken()
if (!token) return false
try {
await api.post(`/auth/verify?token=${encodeURIComponent(token)}`)
await api.post('/auth/verify', { token })
return true
} catch {
return false