优化结构

This commit is contained in:
Yvan
2026-08-23 02:36:58 +08:00
parent 7d89e2ea4d
commit 40632c5756
50 changed files with 408 additions and 115 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import (
"kra/internal/biz/system"
"kra/internal/conf"
"kra/internal/service"
"kra/internal/utils/routepath"
"github.com/gin-gonic/gin"
)
@@ -30,7 +30,7 @@ func AccessControl(runtime *conf.Runtime, access accessController) gin.HandlerFu
path := c.Request.URL.Path
policyPath := path
if config := runtime.Admin(); config != nil {
policyPath = service.NormalizeRoutePath(policyPath, config.RouterPrefix)
policyPath = routepath.Normalize(policyPath, config.RouterPrefix)
}
allowed, err := access.Authorize(c.Request.Context(), claims.AuthorityID, policyPath, c.Request.Method)
if err != nil || !allowed {