Files

52 lines
1.2 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
title WpywMail 客户端
cd /d "%~dp0"
rem 账户配置就地放在 data\ 目录(便携;首次运行可在界面里登录)
set "WPYWMAIL_CONFIG_DIR=%~dp0data"
set "WPYWMAIL_PORT=8788"
where node >nul 2>nul
if errorlevel 1 (
echo.
echo 没有找到 node。请先安装 Node.js(https://nodejs.org/,需要 20 以上版本)。
echo.
pause
exit /b 1
)
rem 界面产物不存在就先构建(换了新界面:shadcn/ui + Vite)
if not exist "ui\dist\index.html" (
echo.
echo 界面还没构建,正在安装依赖并构建(首次大约一两分钟)...
echo.
if not exist "ui\node_modules" (
call npm --prefix ui install --no-audit --no-fund
if errorlevel 1 (
echo 依赖安装失败。请检查网络后重试。
pause
exit /b 1
)
)
call npm --prefix ui run build
if errorlevel 1 (
echo 界面构建失败。
pause
exit /b 1
)
)
echo.
echo 正在启动 WpywMail 客户端...
echo.
rem 稍等一秒再开浏览器,避免打开时服务还没监听
start "" /b cmd /c "timeout /t 2 >nul & start http://127.0.0.1:%WPYWMAIL_PORT%/"
node "server\index.js"
echo.
echo 客户端已退出。
pause