端口规划落地:Mock 默认挪 8798,8788 让给 OpsxDB;/home 落地页别名

- 本机端口约定:8787=OpsxAPI / 8788=OpsxDB / 8789=OpsXShell;mock 独立监听默认改 0.0.0.0:8798(run.sh、main.go、api.go 三处同步,README 4 处引用更新)
- mountHomepage 增加 /home、/index.html → / 别名:静态站导航里的 /home 链接不再 404
- 三站资产扫描零断链(含 opsxshell 下载 dmg 已就位)
This commit is contained in:
logan committed 2026-10-16 03:11:50 +08:00
1 parent 2bb4ef7a95
commit 68a933e6fb
5 files changed
+11 -7

No files matched your search

+1 -1
View File
@@ -512,7 +512,7 @@ func (a *API) handleLocalMockStatus(c *gin.Context) {
}
addr := os.Getenv("OPSXAPI_MOCK_ADDR")
if addr == "" {
addr = "0.0.0.0:8788"
addr = "0.0.0.0:8798" // 8788 让给 OpsxDB;见 cmd/opsxapi/main.go
}
bindHost, port, err := net.SplitHostPort(addr)
if err != nil {
+3
View File
@@ -71,6 +71,9 @@ func mountHomepage(r *gin.Engine) bool {
return
}
upath := strings.TrimPrefix(p, "/")
if upath == "home" || upath == "index.html" {
c.Request.URL.Path = "/" // 落地页别名:导航里的 /home 链接
}
if upath != "" {
if st2, err2 := os.Stat(filepath.Join(dir, upath)); err2 == nil && st2.IsDir() {
c.Request.URL.Path = p + "/"