Files
AIclinicalresearch/测试API.bat
AI Clinical Dev Team 239c7ea85e feat: Day 21-22 - knowledge base frontend completed, fix CORS and file upload issues
- Complete knowledge base list and detail pages
- Complete document upload component
- Fix CORS config (add PUT/DELETE method support)
- Fix file upload issues (disabled state and beforeUpload return value)
- Add detailed debug logs (cleaned up)
- Create Day 21-22 completion summary document
2025-10-11 15:40:12 +08:00

93 lines
2.2 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
echo ========================================
echo API测试工具
echo ========================================
echo.
echo [测试1] 后端健康检查
echo URL: http://localhost:3001/health
curl -s http://localhost:3001/health
if errorlevel 1 (
echo.
echo ❌ 后端服务未响应
echo 解决方案: cd backend ^&^& npm run dev
goto :end
) else (
echo.
echo ✅ 后端服务正常
)
echo.
echo ----------------------------------------
echo.
echo [测试2] 获取项目列表
echo URL: http://localhost:3001/api/v1/projects
curl -s http://localhost:3001/api/v1/projects
if errorlevel 1 (
echo.
echo ❌ 获取项目列表失败
) else (
echo.
echo ✅ 获取项目列表成功
)
echo.
echo ----------------------------------------
echo.
echo [测试3] 获取智能体列表
echo URL: http://localhost:3001/api/v1/agents
curl -s http://localhost:3001/api/v1/agents
if errorlevel 1 (
echo.
echo ❌ 获取智能体列表失败
) else (
echo.
echo ✅ 获取智能体列表成功
)
echo.
echo ----------------------------------------
echo.
echo [测试4] 创建测试项目
echo URL: http://localhost:3001/api/v1/projects
echo 正在创建项目...
curl -X POST http://localhost:3001/api/v1/projects -H "Content-Type: application/json" -d "{\"name\":\"API测试项目\",\"background\":\"这是通过脚本创建的测试项目\",\"researchType\":\"observational\"}"
if errorlevel 1 (
echo.
echo ❌ 创建项目失败
) else (
echo.
echo ✅ 创建项目成功
)
echo.
echo ----------------------------------------
echo.
echo [测试5] 前端服务检查
echo URL: http://localhost:3000
curl -s http://localhost:3000 >nul 2>&1
if errorlevel 1 (
echo ❌ 前端服务未响应
echo 解决方案: cd frontend ^&^& npm run dev
) else (
echo ✅ 前端服务正常
)
echo.
:end
echo ========================================
echo 测试完成
echo ========================================
echo.
echo 如果所有测试都通过,但浏览器仍有问题:
echo 1. 按 Ctrl + Shift + R 强制刷新浏览器
echo 2. 查看浏览器控制台F12的错误信息
echo 3. 查看解决方案-前端获取数据失败.md
echo.
pause