数据模型使用指针类型字段以避免空值自动更新的问题
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"log/slog"
|
||||
"platform/pkg/u"
|
||||
auth2 "platform/web/auth"
|
||||
"platform/web/core"
|
||||
proxy2 "platform/web/domains/proxy"
|
||||
g "platform/web/globals"
|
||||
"platform/web/globals/orm"
|
||||
@@ -65,7 +66,7 @@ func OnlineProxy(c *fiber.Ctx) (err error) {
|
||||
Version: int32(req.Version),
|
||||
Type: int32(proxy2.TypeSelfHosted),
|
||||
Host: ip.String(),
|
||||
Secret: secret,
|
||||
Secret: &secret,
|
||||
Status: 1,
|
||||
}
|
||||
err = q.Proxy.
|
||||
@@ -90,12 +91,15 @@ func OnlineProxy(c *fiber.Ctx) (err error) {
|
||||
|
||||
var permits []ProxyPermit
|
||||
for _, channel := range channels {
|
||||
if channel.EdgeID == nil {
|
||||
return core.NewBizErr("通道未分配边缘节点")
|
||||
}
|
||||
permit := ProxyPermit{
|
||||
Id: channel.EdgeID,
|
||||
Id: *channel.EdgeID,
|
||||
Expire: time.Time(channel.Expiration),
|
||||
Whitelists: u.P(strings.Split(channel.Whitelists, ",")),
|
||||
Username: &channel.Username,
|
||||
Password: &channel.Password,
|
||||
Whitelists: u.P(strings.Split(u.Z(channel.Whitelists), ",")),
|
||||
Username: channel.Username,
|
||||
Password: channel.Password,
|
||||
}
|
||||
permits = append(permits, permit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user