sync: 对齐小程序 v1.0.2 生产代码并脱敏

This commit is contained in:
MiFaZhan
2026-10-29 15:15:12 +08:00
parent a7abd476f0
commit 5fcf74deb0
423 changed files with 15001 additions and 6382 deletions
+19
View File
@@ -3,7 +3,11 @@ package router
import (
"context"
"github.com/gogf/gf/v2/errors/gcode"
"git.5iot.com/iotlcm-public/iotlcm-app/internal/controller/app"
"git.5iot.com/iotlcm-public/iotlcm-app/internal/library/contexts"
"git.5iot.com/iotlcm-public/iotlcm-app/internal/library/mcache"
"git.5iot.com/iotlcm-public/iotlcm-app/internal/packed/response"
"git.5iot.com/iotlcm-public/iotlcm-app/internal/service"
"github.com/gogf/gf/v2/net/ghttp"
@@ -12,10 +16,25 @@ import (
func App(ctx context.Context, group *ghttp.RouterGroup) {
group.Group("/", func(group *ghttp.RouterGroup) {
group.Middleware(
func(r *ghttp.Request) {
ctx := r.GetCtx()
userId := contexts.GetUserId(ctx)
if userId != 0 && !contexts.IsSuperAdmin(ctx) {
freshCtx, err := mcache.WithFreshUserAccess(ctx, userId)
if err != nil {
response.JsonExit(r, gcode.CodeNotAuthorized.Code(), "权限校验失败,请重试")
return
}
r.SetCtx(freshCtx)
}
r.Middleware.Next()
},
service.Middleware().Auth,
)
group.Bind(
app.NewV1(),
&app.ExecutionLogController{},
&app.AllocateResultController{},
)
})
}
+1 -1
View File
@@ -1,7 +1,7 @@
// package router
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package router
+1 -1
View File
@@ -1,7 +1,7 @@
// package router
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package router
+1 -1
View File
@@ -1,7 +1,7 @@
// package router
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package router
+1 -1
View File
@@ -1,7 +1,7 @@
// package genrouter
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package genrouter
@@ -1,7 +1,7 @@
// Package genrouter
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
// @AutoGenerate Version
package genrouter
@@ -1,7 +1,7 @@
// Package genrouter
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2026 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
// @AutoGenerate Version
package genrouter
@@ -10,4 +10,4 @@ import "git.5iot.com/iotlcm-public/iotlcm-app/internal/controller/gen"
func init() {
LoginRequiredRouter = append(LoginRequiredRouter, gen.TestTree) // 测试树表
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
// package router
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package router
+1 -1
View File
@@ -1,7 +1,7 @@
// package router
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package router
+1 -1
View File
@@ -1,7 +1,7 @@
// package router
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <li@xiujie.cn>
// @Author Lxj <li@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package router