feat: 自动提交 - 周一 2025/09/22 15:12:38.91

This commit is contained in:
赵杰
2025-09-22 15:12:38 +01:00
parent 9306e7a401
commit b635c9e7d4
41 changed files with 7360 additions and 950 deletions

60
build_frontend.sh Normal file
View File

@@ -0,0 +1,60 @@
#!/bin/bash
echo "构建TSP智能助手前端..."
echo
# 检查Node.js环境
echo "检查Node.js环境..."
if ! command -v node &> /dev/null; then
echo "错误: 未找到Node.js请先安装Node.js"
echo "安装命令:"
echo " Ubuntu/Debian: sudo apt update && sudo apt install nodejs npm"
echo " CentOS/RHEL: sudo yum install nodejs npm"
echo " 或访问: https://nodejs.org/"
exit 1
fi
# 检查npm环境
echo "检查npm环境..."
if ! command -v npm &> /dev/null; then
echo "错误: 未找到npm请检查Node.js安装"
exit 1
fi
echo "Node.js版本: $(node --version)"
echo "npm版本: $(npm --version)"
echo
# 进入前端目录
cd frontend
# 检查依赖包
echo "检查依赖包..."
if [ ! -d "node_modules" ]; then
echo "安装依赖包..."
npm install
if [ $? -ne 0 ]; then
echo "错误: 依赖包安装失败"
exit 1
fi
fi
# 运行类型检查
echo "运行类型检查..."
npm run type-check
if [ $? -ne 0 ]; then
echo "警告: 类型检查失败,但继续构建..."
fi
# 构建生产版本
echo "构建生产版本..."
npm run build
if [ $? -ne 0 ]; then
echo "错误: 构建失败"
exit 1
fi
echo
echo "构建完成!"
echo "构建文件已输出到: ../src/web/static/dist"
echo