Files
yuyueguahao/scripts/deploy-v8-admin-simplify.sh
2026-07-05 14:43:34 +08:00

49 lines
2.0 KiB
Bash
Executable File
Raw Permalink 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.
#!/bin/bash
# 部署 admin/ 后台优化(删除医生/专家/科室 + 简化电话设置)
set -e
PASSWORD="Szgt888."
HOST="124.221.67.199"
USER="root"
REMOTE="/opt/yuyueguahao"
SSH="sshpass -p $PASSWORD ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${USER}@${HOST}"
SCP="sshpass -p $PASSWORD scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
echo ">>> STEP 1: 上传 admin 文件"
$SCP admin/index.html ${USER}@${HOST}:${REMOTE}/admin/index.html
$SCP admin/app.js ${USER}@${HOST}:${REMOTE}/admin/app.js
echo " OK"
echo ">>> STEP 2: 验证服务器上的文件已更新"
$SSH "stat -c '%y %s %n' /opt/yuyueguahao/admin/index.html /opt/yuyueguahao/admin/app.js"
echo ""
echo ">>> STEP 3: 验证 admin/app.js 不再含医生/专家/科室"
echo "--- DEPT_OPTIONS ---"
$SSH "grep -c 'DEPT_OPTIONS' /opt/yuyueguahao/admin/app.js"
echo "--- renderDoctors ---"
$SSH "grep -c 'renderDoctors' /opt/yuyueguahao/admin/app.js"
echo "--- renderExperts ---"
$SSH "grep -c 'renderExperts' /opt/yuyueguahao/admin/app.js"
echo "--- renderDepartments ---"
$SSH "grep -c 'renderDepartments' /opt/yuyueguahao/admin/app.js"
echo "--- sitePhone2/siteWorkHours/siteAddress/siteWechat (应为 0) ---"
$SSH "grep -cE 'sitePhone2|siteWorkHours|siteAddress|siteWechat' /opt/yuyueguahao/admin/app.js"
echo "--- sitePhone (应为 >0) ---"
$SSH "grep -c 'sitePhone' /opt/yuyueguahao/admin/app.js"
echo ""
echo ">>> STEP 4: 验证侧栏(HTML 中应只剩 7 个 side-link"
$SSH "grep -c 'side-link' /opt/yuyueguahao/admin/index.html"
echo "--- 关键导航文字(医生/专家/科室应为 0)---"
$SSH "grep -cE '医生|专家|科室' /opt/yuyueguahao/admin/index.html"
echo ""
echo ">>> STEP 5: 验证 admin 可访问(HTTP 200 + 关键内容)"
$SSH "curl -s -o /dev/null -w 'HTTP %{http_code} size=%{size_download}\n' https://y.szgtlive.com/admin/index.html"
echo "--- 通过 nginx 访问 admin/app.js(同样应 200---"
$SSH "curl -s -o /dev/null -w 'HTTP %{http_code} size=%{size_download}\n' https://y.szgtlive.com/admin/app.js"
echo ""
echo ">>> DONE"