finally finish all website check in.

This commit is contained in:
Jiao77
2025-10-01 09:51:06 +08:00
parent d40ae5a8d9
commit 96b50327f3
102 changed files with 11724 additions and 4945 deletions

View File

@@ -56,13 +56,33 @@ build_project() {
exit 1
fi
# 确保全局样式被包含到部署包中
if [ -f "src/styles/global.css" ]; then
mkdir -p dist/src/styles
cp src/styles/global.css dist/src/styles/global.css
echo "🎨 已复制 global.css 到 dist/src/styles/"
# 检查必要的静态文件
echo "🔍 检查静态资源..."
# 检查是否有图片资源
if [ -d "public/report" ]; then
echo "✅ 找到报告图片资源"
else
echo "⚠️ 未找到 src/styles/global.css跳过复制"
echo "⚠️ 未找到 public/report 目录"
fi
# 检查 SEO 相关文件
if [ -f "public/robots.txt" ]; then
echo "✅ robots.txt 存在"
else
echo "⚠️ 建议添加 robots.txt 文件"
fi
if [ -f "public/sitemap.xml" ]; then
echo "✅ sitemap.xml 存在"
else
echo "⚠️ 建议添加 sitemap.xml 文件"
fi
if [ -f "public/favicon.ico" ]; then
echo "✅ favicon.ico 存在"
else
echo "⚠️ 建议添加 favicon.ico 文件"
fi
echo "✅ 构建完成"
@@ -203,10 +223,47 @@ show_results() {
echo ""
}
# 部署前最终检查
pre_deploy_check() {
echo ""
echo "🔎 部署前最终检查..."
# 检查构建产物
if [ ! -f "dist/index.html" ]; then
echo "❌ 错误: 构建产物不完整,缺少 index.html"
exit 1
fi
# 检查报告页面是否存在
if [ ! -f "dist/reports/index.html" ]; then
echo "⚠️ 警告: reports 页面可能不存在"
fi
# 检查重要静态资源
MISSING_FILES=()
if [ ! -f "dist/robots.txt" ]; then
MISSING_FILES+=("robots.txt")
fi
if [ ! -f "dist/sitemap.xml" ]; then
MISSING_FILES+=("sitemap.xml")
fi
if [ ${#MISSING_FILES[@]} -gt 0 ]; then
echo "⚠️ 以下 SEO 文件缺失: ${MISSING_FILES[*]}"
else
echo "✅ SEO 文件检查通过"
fi
echo "✅ 部署前检查完成"
}
# 主函数
main() {
check_requirements
build_project
pre_deploy_check
get_deploy_config
deploy_files
set_permissions