更新 API 路由,添加获取所有代理、心跳、锁和会议的端点;修改会议队列和前端请求处理;新增前端完整测试脚本。

This commit is contained in:
Claude Code
2026-03-09 18:24:14 +08:00
parent dc398d7c7b
commit 7a5a58b4e5
17 changed files with 302 additions and 28 deletions

View File

@@ -19,7 +19,19 @@ async function request<T>(
endpoint: string,
options?: RequestInit
): Promise<T> {
const url = `${API_BASE}${endpoint}`;
// 自动添加末尾斜杠避免 307 重定向
let normalizedEndpoint = endpoint;
if (endpoint.includes('?')) {
// 带查询参数:在 ? 之前添加斜杠
const [path, query] = endpoint.split('?');
if (!path.endsWith('/')) {
normalizedEndpoint = `${path}/?${query}`;
}
} else if (!endpoint.match(/\/[^/]+$/)) {
// 不带查询参数且不以路径结尾:添加斜杠
normalizedEndpoint = `${endpoint}/`;
}
const url = `${API_BASE}${normalizedEndpoint}`;
const response = await fetch(url, {
headers: {
'Content-Type': 'application/json',