diff --git a/apps/blogai/components/header.tsx b/apps/blogai/components/header.tsx index 3a28fee..00fddb9 100644 --- a/apps/blogai/components/header.tsx +++ b/apps/blogai/components/header.tsx @@ -515,6 +515,8 @@ export function DetailPageHeader({ data }: { data: any }) { console.log("====> deploy status result:", result); const status = result?.data?.data?.status; + console.log("🟡 [fetch] 拉取状态 status =", status); + const userData = JSON.parse(localStorage.getItem("UserData") || "null"); const userName = userData?.user_name; const id = data?.id; @@ -522,11 +524,13 @@ export function DetailPageHeader({ data }: { data: any }) { setStatusLoaded(true); if (status === "deploying" && userName && id && !hasWSConnected) { + console.log("🔄 自动连接 WebSocket: 正在部署中..."); setStatusText("检测到正在部署,连接中..."); initWebSocket(userName, id); } if (!result || result.header?.code !== 1006) { + console.warn("🚫 状态接口返回失败或 code 错误", result.header); setStatusText(result?.header?.message || "操作失败(后端返回错误)"); setShowDelete(false); return; @@ -536,8 +540,10 @@ export function DetailPageHeader({ data }: { data: any }) { // ✅ 只在 running / stopped 显示删除按钮 if (status === "running" || status === "stopped") { + console.log("✅ 状态允许删除,显示删除按钮"); setShowDelete(true); } else { + console.log("❌ 状态不允许删除,隐藏按钮"); setShowDelete(false); } } catch (err) {