修复通道注册失败问题

This commit is contained in:
2025-12-05 18:57:52 +08:00
parent 5649a03c47
commit 9e237be21e
6 changed files with 17 additions and 22 deletions

View File

@@ -1,10 +1,9 @@
package handlers
import (
"log/slog"
"net/netip"
"platform/pkg/env"
g "platform/web/globals"
"platform/web/core"
s "platform/web/services"
"time"
@@ -16,18 +15,9 @@ func DebugRegisterProxyBaiYin(c *fiber.Ctx) error {
return fiber.ErrNotFound
}
ok, err := g.Redis.SetNX(c.Context(), "debug:channel:register:127.0.0.1", true, 0).Result()
err := s.Proxy.RegisterBaiyin("1a:2b:3c:4d:5e:6f", netip.AddrFrom4([4]byte{127, 0, 0, 1}), "test", "test")
if err != nil {
return err
}
slog.Info("注册代理", "ok", ok)
if !ok {
return fiber.ErrConflict
}
err = s.Proxy.RegisterBaiyin("1a:2b:3c:4d:5e:6f", netip.AddrFrom4([4]byte{127, 0, 0, 1}), "test", "test")
if err != nil {
return err
return core.NewServErr("注册失败", err)
}
return nil