重构连接监听与处理代码逻辑,连接信息存储于全局通过接口展示
This commit is contained in:
@@ -6,12 +6,12 @@ import (
|
||||
"proxy-server/gateway/core"
|
||||
)
|
||||
|
||||
type AuthReq struct {
|
||||
type PermitReq struct {
|
||||
Id int32 `json:"id"`
|
||||
core.Permit
|
||||
}
|
||||
|
||||
func Auth(ctx *fiber.Ctx) (err error) {
|
||||
func Permit(ctx *fiber.Ctx) (err error) {
|
||||
|
||||
// 安全验证
|
||||
var sec core.SecuredReq
|
||||
@@ -20,7 +20,7 @@ func Auth(ctx *fiber.Ctx) (err error) {
|
||||
}
|
||||
|
||||
// 获取请求参数
|
||||
req, err := core.Decrypt[AuthReq](&sec, app.PlatformSecret)
|
||||
req, err := core.Decrypt[PermitReq](&sec, app.PlatformSecret)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user