diff --git a/scripts/ci_production_healthcheck.sh b/scripts/ci_production_healthcheck.sh index a73fd5ba0..72abd9f26 100644 --- a/scripts/ci_production_healthcheck.sh +++ b/scripts/ci_production_healthcheck.sh @@ -160,11 +160,11 @@ health_check() { web_ok=true fi - # 检查 API docs + # 检查 API docs(生产环境禁用 /docs,404 表示 API 在正常响应,视为健康) if [ "$api_docs_ok" = false ]; then HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "${PROD_API_URL}/docs" 2>/dev/null || echo "000") - if [ "$HTTP_CODE" = "200" ]; then - log_info "✅ API Docs 检查通过" + if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "404" ]; then + log_info "✅ API Docs 检查通过(HTTP $HTTP_CODE)" api_docs_ok=true fi fi