:art:做了一些bug修复和变动

This commit is contained in:
coward
2024-05-24 15:19:26 +08:00
parent e216725096
commit e172b3c838
12 changed files with 64 additions and 49 deletions

View File

@@ -4,7 +4,6 @@ import (
"gitee.ltd/lxh/logger/log"
"github.com/gin-gonic/gin"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"strings"
"wireguard-dashboard/command"
"wireguard-dashboard/http/param"
"wireguard-dashboard/model/entity"
@@ -45,7 +44,7 @@ func (server) SaveServer(c *gin.Context) {
}
publicKey := privateKey.PublicKey()
serverInfo := &entity.Server{
IpScope: strings.Join(p.IpScope, ","),
IpScope: p.IpScope,
ListenPort: p.ListenPort,
PrivateKey: privateKey.String(),
PublicKey: publicKey.String(),
@@ -84,10 +83,6 @@ func (server) GetServer(c *gin.Context) {
log.Errorf("获取服务端信息失败: %v", err.Error())
}
if data.IpScopeStr != "" {
data.IpScope = strings.Split(data.IpScopeStr, ",")
}
utils.GinResponse(c).OKWithData(data)
}

View File

@@ -51,7 +51,7 @@ func (setting) SetServerGlobal(c *gin.Context) {
return
}
data, _ := json.Marshal(p.Data)
data, _ := json.Marshal(p)
var ent entity.Setting
ent.Code = "SERVER_SETTING"