Files
huangjingfen/docs/deploy-h5-diagnose.sh
apple ae8b866319 feat(fsgx): 管理后台与部署相关更新
- admin: 路由守卫修复空白页、addRoute、devServer 端口与代理
- admin: package.json 生产构建去掉 NODE_OPTIONS openssl
- ajcaptcha: 滑块验证码改用 file 缓存避免 Redis NOAUTH
- nginx-crmeb: 增加 81 端口站点
- docs: deploy 补充 NOAUTH/Redis 说明,新增 H5 部署脚本与 nginx 示例
- 其他: database、start-api、swoole ini、uniapp 资源等

Made-with: Cursor
2026-03-21 02:33:14 +08:00

25 lines
1.1 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.
#!/usr/bin/env bash
# 诊断 H5 部署问题Unexpected token '<'
# 在服务器上检查文件是否存在、index.html 引用、Nginx root
set -e
REMOTE="root@182.92.142.158"
REMOTE_PUBLIC="/www/wwwroot/hjf.suzhouyuqi.com/public"
echo "=== 1. 检查 index.html 引用的 JS 文件 ==="
ssh "$REMOTE" "grep -oE 'src=[^>]+\.js' $REMOTE_PUBLIC/index.html 2>/dev/null || echo 'index.html 不存在或无法读取'"
echo ""
echo "=== 2. 检查 static/js 下实际存在的文件 ==="
ssh "$REMOTE" "ls $REMOTE_PUBLIC/static/js/index.*.js $REMOTE_PUBLIC/static/js/chunk-vendors.*.js 2>/dev/null || echo '文件不存在'"
echo ""
echo "=== 3. 直接请求 JS 看返回类型(应为 application/javascript ==="
curl -sI "https://hjf.suzhouyuqi.com/static/js/chunk-vendors.54d49a5a.js" | head -5
echo ""
echo "=== 4. 若上面 Content-Type 不是 javascript说明 Nginx 未正确提供静态文件 ==="
echo "请在宝塔/面板中检查站点配置:"
echo " - root 必须为: $REMOTE_PUBLIC"
echo " - 添加 location ~ ^/(static|assets|pages)/ { try_files \$uri =404; }"
echo "参考: docs/nginx-hjf-cloud.conf.example"