This repository has been archived on 2026-04-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Exam_registration/start.bat

86 lines
1.7 KiB
Batchfile
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.
@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