add: User transmission interface encryption

This commit is contained in:
EUForest
2025-10-12 16:23:29 +08:00
parent f3bc933a99
commit 46e6a9784d
27 changed files with 410 additions and 22 deletions
+26
View File
@@ -0,0 +1,26 @@
package initialize
import (
"context"
"github.com/perfect-panel/server/pkg/logger"
"github.com/perfect-panel/server/internal/config"
"github.com/perfect-panel/server/internal/model/auth"
"github.com/perfect-panel/server/internal/svc"
"github.com/perfect-panel/server/pkg/tool"
)
func Device(ctx *svc.ServiceContext) {
logger.Debug("device config initialization")
method, err := ctx.AuthModel.FindOneByMethod(context.Background(), "device")
if err != nil {
panic(err)
}
var cfg config.DeviceConfig
var deviceConfig auth.DeviceConfig
deviceConfig.Unmarshal(method.Config)
tool.DeepCopy(&cfg, deviceConfig)
cfg.Enable = *method.Enabled
ctx.Config.Device = cfg
}
+1
View File
@@ -9,6 +9,7 @@ func StartInitSystemConfig(svc *svc.ServiceContext) {
Site(svc)
Node(svc)
Email(svc)
Device(svc)
Invite(svc)
Verify(svc)
Subscribe(svc)