weekreport/install.bat
2026-01-09 11:00:31 +08:00

61 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
echo ========================================
echo 智能周报生成器 - 安装脚本
echo ========================================
echo.
REM 检查 PHP
where php >nul 2>nul
if %errorlevel% neq 0 (
echo [错误] 未找到 PHP请先安装 PHP 8.1 或更高版本
pause
exit /b 1
)
REM 检查 Composer
where composer >nul 2>nul
if %errorlevel% neq 0 (
echo [错误] 未找到 Composer请先安装 Composer
pause
exit /b 1
)
echo [1/4] 安装 PHP 依赖...
call composer install
if %errorlevel% neq 0 (
echo [错误] Composer 安装失败
pause
exit /b 1
)
echo.
echo [2/4] 配置环境文件...
if not exist ".env" (
copy env.txt .env >nul
echo 已创建 .env 文件
) else (
echo .env 文件已存在,跳过
)
echo.
echo [3/4] 生成应用密钥...
php artisan key:generate --ansi
echo.
echo [4/4] 创建存储软链接...
php artisan storage:link
echo.
echo ========================================
echo 安装完成!
echo ========================================
echo.
echo 启动开发服务器:
echo php artisan serve
echo.
echo 然后访问http://localhost:8000
echo.
pause