优化全局数据存储方式,以节点 id 为 key 保存相关数据;修复节点下线监听未关闭问题
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
)
|
||||
|
||||
type AuthReq struct {
|
||||
Port uint16 `json:"port"`
|
||||
Id int32 `json:"id"`
|
||||
core.Permit
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ func Auth(ctx *fiber.Ctx) (err error) {
|
||||
}
|
||||
|
||||
// 保存授权配置
|
||||
app.PermitEdge(req.Port, &req.Permit)
|
||||
app.Permits.Store(req.Id, &req.Permit)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user