修改:未开启权限验证情况下的消息推送bug

This commit is contained in:
2023-11-28 17:04:17 +08:00
parent b80dc78cce
commit e27f01cb34
6 changed files with 55 additions and 18 deletions

View File

@@ -8,6 +8,7 @@ import (
"strings"
"sync"
"time"
"zhub/internal/config"
)
type User struct {
@@ -63,6 +64,12 @@ type PermissionManager struct {
func (p *PermissionManager) Init() error {
p.lock.Lock()
defer p.lock.Unlock()
Conf := config.ReadConfig()
if !Conf.Service.Auth {
return nil
}
// Load YAML configuration from file
data, err := os.ReadFile("./auth.yml")
if err != nil {