重构认证授权逻辑,集中到 auth 包中

This commit is contained in:
2025-05-12 10:07:12 +08:00
parent cfdee98a1b
commit 2c37dcc2be
40 changed files with 905 additions and 455 deletions

View File

@@ -198,10 +198,7 @@ type RemoveChannelsReq struct {
func RemoveChannels(c *fiber.Ctx) error {
// 检查权限
authCtx, err := auth.Protect(c, []auth.PayloadType{
auth.PayloadUser,
auth.PayloadSecuredServer,
}, []string{})
authCtx, err := auth.Protect(c, []auth.PayloadType{auth.PayloadUser, auth.PayloadInternalServer}, []string{})
if err != nil {
return err
}