From 9e907bde57c60697871aa3947ddec535708e4064 Mon Sep 17 00:00:00 2001 From: john Date: Fri, 26 Jun 2026 12:42:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E9=95=BF=20preview=20=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=AD=89=E5=BE=85=EF=BC=8C=E9=81=BF=E5=85=8D=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=84=9A=E6=9C=AC=E8=AF=AF=E5=88=A4=20/auth=20?= =?UTF-8?q?=E5=8F=8D=E4=BB=A3=E6=9C=AA=E5=B0=B1=E7=BB=AA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- scripts/remote_restart.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/remote_restart.sh b/scripts/remote_restart.sh index 3125976..b7f6240 100755 --- a/scripts/remote_restart.sh +++ b/scripts/remote_restart.sh @@ -72,11 +72,19 @@ fi echo "==> 启动 vite preview @ ${WEB_HOST}:${PORT} (base=${BASE_PATH})..." nohup npx vite preview --config scripts/vite-preview.config.mjs >>"${LOG}" 2>&1 & echo $! >"${PID_FILE}" -sleep 2 +sleep 3 preview_url="http://127.0.0.1:${PORT}${BASE_PATH}" login_probe="http://127.0.0.1:${PORT}/auth/status" -if curl -sf "${preview_url}" >/dev/null && curl -sf "${login_probe}" >/dev/null; then +auth_ok=0 +for _ in 1 2 3 4 5; do + if curl -sf "${preview_url}" >/dev/null && curl -sf "${login_probe}" >/dev/null; then + auth_ok=1 + break + fi + sleep 2 +done +if [[ "${auth_ok}" -eq 1 ]]; then echo "✅ memind_adm 已就绪: ${preview_url}" curl -sf "${preview_url}" >/dev/null && echo " 首页 OK" echo " /auth 反代 OK"