cc5117d6d68797d2c2d141d7b451ce91f82c0981
Migu2.0
迷毂智能调度平台主仓库(平台后端 + 平台前端)。
该仓库承接原 Simple 仓库中的平台层能力,当前以 MiGu.Server 作为统一入口;调度内核 SimpleLite 仍在相邻仓库 ../Simple 中维护。
仓库定位
- 平台后端:
MiGu.Server(ASP.NET Core 8 + YARP,默认:8080) - 平台前端:
frontends/apps/simple-platform-vue(Vue 3 + Vite) - 调度内核:
SimpleLite(不在本仓库,位于../Simple/SimpleLite) - 运行模式:用户登录后由
MiGu.Server按启动模式拉起SimpleLite.exe
目录结构
Migu2.0/
├── MiGu.Server/ # 平台后端入口工程
│ ├── Controllers/ # Auth/Config/Ops/Health 等 API
│ ├── Launcher/ # SimpleLite 子进程拉起与健康探测
│ ├── Auth/ # JWT / 用户鉴权 / 内部 token
│ ├── Configs/ # 平台配置中心模型与存取
│ ├── wwwroot/ # 已构建前端静态资源(部署用)
│ ├── appsettings.json # 启动、YARP、SimpleLite 路径配置
│ └── README.md # 后端详细说明
├── frontends/ # 平台前端源码 workspace
│ └── apps/simple-platform-vue/
├── build-platform-frontend.bat # 一键构建前端并同步到 MiGu.Server/wwwroot
├── MiGu.Server.sln
├── ARCHITECTURE.md
├── PLATFORM_V3_CHANGES.md
└── Doc/
与 SimpleLite 的关系
Migu2.0 与 SimpleLite 是分仓协作关系:
MiGu.Server提供登录、权限、配置中心、平台 UI 托管与网关能力SimpleLite提供调度内核、投影接口、3D/仿真运行时能力- 两者通过以下链路协作:
- 进程编排:
MiGu.Server登录后调用SimpleLiteLauncher拉起SimpleLite.exe - 接口代理:
/api/sl/*通过 YARP 转发到http://127.0.0.1:8222/ - 3D 页面代理:
/vr/*转发到http://127.0.0.1:8223/
- 进程编排:
默认开发路径(可改)在 MiGu.Server/appsettings.json:
"SimpleLite": {
"Enabled": true,
"ExecutablePath": "..\\..\\Simple\\SimpleLite\\bin\\Debug\\SimpleLite.exe",
"WorkingDirectory": "..\\..\\Simple\\SimpleLite\\bin\\Debug",
"ProjectionPort": 8222
}
快速启动(开发机)
1) 先编译 SimpleLite
cd ..\Simple
dotnet build SimpleLite\SimpleLite.csproj -c Debug
2) 启动 MiGu.Server
cd ..\Migu2.0\MiGu.Server
dotnet run
打开 http://localhost:8080/login,使用默认开发账号:
admin / adminops / ops
仅调试平台页面、不拉起内核:将
MiGu.Server/appsettings.json中SimpleLite.Enabled改为false。
前端构建与发布
仓库根目录提供脚本:
cd E:\Work\Core\Simple-FR\Migu2.0
.\build-platform-frontend.bat
该脚本会执行三步:
- 在
frontends安装依赖(pnpm 优先) - 构建
simple-platform-vue - 将
dist同步到MiGu.Server/wwwroot
仅构建不同步启动后端:
.\build-platform-frontend.bat --no-start
部署说明(生产)
- 发布内容至少包含:
MiGu.Server可执行文件及依赖MiGu.Server/wwwroot静态资源
- 生产环境务必覆盖以下配置(不要使用默认值):
Jwt.SecretInternal.TokenAuth.Users.*.PasswordSimpleLite.ExecutablePath/WorkingDirectory(按部署实际路径)
推荐通过环境变量覆盖(__ 表示层级):
$env:Jwt__Secret = "<strong-secret>"
$env:Internal__Token = "<internal-token>"
$env:Auth__Users__admin__Password = "<strong-password>"
常见检查点
http://localhost:8080/api/health:后端健康http://localhost:8080/api/health/simplelite:SimpleLite 路径与端口诊断- 访问平台时若出现
502:通常表示SimpleLite的8222未就绪或未启动
相关文档
MiGu.Server/README.md:后端细节(鉴权、YARP、启动参数、联调)ARCHITECTURE.md:整体架构说明PLATFORM_V3_CHANGES.md:V3 变更记录
Languages
Vue
47.7%
C#
28.4%
TypeScript
19.7%
CSS
3.8%
Batchfile
0.3%