初始化 MiGu.Server 项目,包含基本的 ASP.NET Core 8 配置、JWT 鉴权、RBAC 权限管理、YARP 反向代理及相关配置文件。新增 build-and-run 脚本以简化构建与运行流程,添加 README 文档以指导用户快速上手。
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
@echo off
|
||||
chcp 65001 >nul
|
||||
setlocal ENABLEDELAYEDEXPANSION
|
||||
|
||||
REM ==========================================================
|
||||
REM MiGu.Server build and run (one-click)
|
||||
REM - default Debug; pass "release" / "-r" / "/r" for Release
|
||||
REM - listens on http://0.0.0.0:8080 (see Properties\launchSettings.json)
|
||||
REM - YARP proxies: /api/sl/* -> :8222 ; /vr/* -> :8223
|
||||
REM ==========================================================
|
||||
|
||||
cd /d "%~dp0"
|
||||
|
||||
set "CONFIG=Debug"
|
||||
if /I "%~1"=="release" set "CONFIG=Release"
|
||||
if /I "%~1"=="-r" set "CONFIG=Release"
|
||||
if /I "%~1"=="/r" set "CONFIG=Release"
|
||||
|
||||
echo ============================================================
|
||||
echo MiGu.Server 生成 + 启动 ( Config = %CONFIG% )
|
||||
echo 目录: %CD%
|
||||
echo ============================================================
|
||||
echo.
|
||||
|
||||
where dotnet >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo [错误] 未找到 dotnet ^( .NET 8 SDK ^)。请先安装 .NET 8 SDK 并重新打开终端。
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo === [1/2] dotnet build ===
|
||||
dotnet build "MiGu.Server.csproj" -c %CONFIG% --nologo
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo *** 构建失败,已停止。请检查上方编译错误。 ***
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo === [2/2] dotnet run ===
|
||||
echo [提示] Ctrl+C 终止;浏览器访问 http://localhost:8080/ ^(Swagger: /swagger^)
|
||||
echo.
|
||||
|
||||
dotnet run --project "MiGu.Server.csproj" -c %CONFIG% --no-build --no-restore
|
||||
set "RUN_EC=%errorlevel%"
|
||||
|
||||
echo.
|
||||
if not "%RUN_EC%"=="0" (
|
||||
echo *** MiGu.Server 退出,errorlevel=%RUN_EC%
|
||||
) else (
|
||||
echo MiGu.Server 正常退出。
|
||||
)
|
||||
endlocal & exit /b %RUN_EC%
|
||||
Reference in New Issue
Block a user