@echo off chcp 65001 >nul echo. echo ==================================== echo MosDNS Vue 版本构建脚本 echo ==================================== echo. echo [1/3] 检查 Node.js 环境... where node >nul 2>nul if errorlevel 1 ( echo ❌ 错误: 未找到 Node.js! echo 请先安装 Node.js: https://nodejs.org/ pause exit /b 1 ) echo ✅ Node.js 已安装 echo. echo [2/3] 构建 Vue 前端... cd web-ui if not exist "node_modules\" ( echo 📦 首次构建,正在安装依赖... call npm install if errorlevel 1 ( echo ❌ npm install 失败! cd .. pause exit /b 1 ) ) echo 🔨 正在构建 Vue 项目... call npm run build if errorlevel 1 ( echo ❌ Vue 构建失败! cd .. pause exit /b 1 ) echo ✅ Vue 构建完成 cd .. echo. echo [3/3] 构建 Go 后端... echo 🔨 正在编译 Go 程序... go build -o dist\mosdns-vue.exe . if errorlevel 1 ( echo ❌ Go 编译失败! pause exit /b 1 ) echo ✅ Go 编译完成 echo. echo ==================================== echo ✅ 构建完成! echo ==================================== echo. echo 可执行文件: dist\mosdns-vue.exe echo. echo 运行命令: echo dist\mosdns-vue.exe start -c config.yaml echo. echo 然后访问: http://localhost:5555 echo. pause