修复安装路由异常

This commit is contained in:
2026-03-30 00:13:17 +08:00
parent c85370aa9d
commit fa84dca0b7

View File

@@ -44,8 +44,9 @@ func InstallCheckMiddleware() gin.HandlerFunc {
}
}
// 如果未安装且不是访问安装接口,则返回 403 JSON
if !isInstalled && !isInstallRoute {
// 如果未安装且是 API 请求但不是安装接口,则返回 403 JSON
// 如果是前端页面请求,不在此处拦截,交由前端 Vue Router 拦截并跳转至安装页
if !isInstalled && !isInstallRoute && len(path) >= 4 && path[:4] == "/api" {
c.JSON(http.StatusForbidden, gin.H{
"code": 403,
"msg": "系统未初始化,请先完成安装",