Files
ai_mip/start.bat
2026-01-13 18:59:26 +08:00

59 lines
1.3 KiB
Batchfile
Raw 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 MIP广告点击服务 - 快速启动脚本
echo ========================================
echo.
REM 检查Python是否安装
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo 错误: 未检测到Python请先安装Python 3.8+
pause
exit /b 1
)
REM 检查是否存在虚拟环境
if not exist "venv" (
echo 未检测到虚拟环境,正在创建...
python -m venv venv
echo 虚拟环境创建完成
echo.
)
REM 激活虚拟环境
echo 激活虚拟环境...
call venv\Scripts\activate.bat
REM 检查是否已安装依赖
pip show flask >nul 2>&1
if %errorlevel% neq 0 (
echo 正在安装依赖包...
pip install -r requirements.txt
echo 依赖安装完成
echo.
echo 正在安装 Playwright 浏览器...
python -m playwright install chromium
echo Playwright 浏览器安装完成
echo.
)
REM 检查.env文件
if not exist ".env" (
echo 警告: 未检测到.env配置文件
echo 请复制.env.example为.env并配置相关参数
echo.
echo 是否继续启动服务?
pause
)
REM 启动服务
echo 正在启动MIP广告点击服务...
echo.
echo 提示:默认使用开发环境配置
echo 如需使用生产环境请设置环境变量set ENV=production
echo.
python app.py
pause