add windows start scripts and update database password in config.yaml

This commit is contained in:
2026-03-20 22:06:38 +08:00
parent c0fc1ea13a
commit 5a8518f6ab
5 changed files with 2274 additions and 0 deletions

85
start.bat Normal file
View File

@@ -0,0 +1,85 @@
@echo off
chcp 65001 >nul
echo ========================================
echo 考试信息管理系统 - 快速启动
echo ========================================
echo.
echo [1/5] 检查 Go 环境...
go version >nul 2>&1
if %errorlevel% neq 0 (
echo ✗ Go 未安装,请先安装 Go 1.21+
pause
exit /b 1
)
echo ✓ Go 已安装
echo.
echo [2/5] 检查 Node.js 环境...
node --version >nul 2>&1
if %errorlevel% neq 0 (
echo ✗ Node.js 未安装,请先安装 Node.js 18+
pause
exit /b 1
)
echo ✓ Node.js 已安装
echo.
echo [3/5] 构建前端...
cd frontend
if not exist "node_modules" (
echo 安装依赖...
call npm install
if %errorlevel% neq 0 (
echo ✗ 依赖安装失败
cd ..
pause
exit /b 1
)
) else (
echo 依赖已存在,跳过安装
)
echo 构建生产版本...
call npm run build
if %errorlevel% neq 0 (
echo ✗ 前端构建失败
cd ..
pause
exit /b 1
)
echo ✓ 前端构建完成
cd ..
echo.
echo [4/5] 检查配置文件...
if exist "config\config.yaml" (
echo ✓ 配置文件存在
echo ⚠️ 请确保 config\config.yaml 中的数据库密码已修改
) else (
echo ✗ 配置文件不存在config\config.yaml
pause
exit /b 1
)
echo.
echo [5/5] 启动后端服务...
echo.
echo ========================================
echo 服务器即将启动...
echo ========================================
echo.
echo 访问地址:
echo 前端http://localhost:8080
echo API: http://localhost:8080/api
echo.
echo 默认登录账号:
echo 用户名admin
echo 密码admin123
echo.
echo 按 Ctrl+C 停止服务
echo.
go run cmd/main.go