网关重启时恢复权限与分配数据

This commit is contained in:
2025-05-26 10:55:44 +08:00
parent 52907b3fae
commit 8c928a8321
5 changed files with 18 additions and 8 deletions

View File

@@ -6,10 +6,7 @@ import (
"proxy-server/gateway/core"
)
type PermitReq struct {
Id int32 `json:"id"`
core.Permit
}
type PermitReq []core.PermitDef
func Permit(ctx *fiber.Ctx) (err error) {
@@ -20,7 +17,7 @@ func Permit(ctx *fiber.Ctx) (err error) {
}
// 获取请求参数
req, err := core.Decrypt[[]PermitReq](&sec, app.PlatformSecret)
req, err := core.Decrypt[PermitReq](&sec, app.PlatformSecret)
if err != nil {
return err
}