From 42b4334d071be3fc0da523e9aadfb5bb25e8d0e5 Mon Sep 17 00:00:00 2001 From: coward Date: Tue, 4 Jun 2024 17:31:45 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=E4=BF=AE=E5=A4=8D=E4=BA=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- http/api/client.go | 4 ++-- http/param/server.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/http/api/client.go b/http/api/client.go index 2be3d55..4d53f57 100644 --- a/http/api/client.go +++ b/http/api/client.go @@ -129,7 +129,7 @@ func (clients) Download(c *gin.Context) { // 处理一下数据 execData := template_data.ClientConfig{ - PrivateKey: keys.PrivateKey, + PrivateKey: data.Server.PrivateKey, IpAllocation: data.IpAllocation, MTU: setting.MTU, DNS: strings.Join(setting.DnsServer, ","), @@ -201,7 +201,7 @@ func (clients) GenerateQrCode(c *gin.Context) { // 处理一下数据 execData := template_data.ClientConfig{ - PrivateKey: keys.PrivateKey, + PrivateKey: data.Server.PrivateKey, IpAllocation: data.IpAllocation, MTU: setting.MTU, PublicKey: keys.PublicKey, diff --git a/http/param/server.go b/http/param/server.go index 0414ee0..0e03af3 100644 --- a/http/param/server.go +++ b/http/param/server.go @@ -4,6 +4,8 @@ type SaveServer struct { Id string `json:"id" form:"id" binding:"omitempty"` // id IpScope string `json:"ipScope" form:"ipScope" binding:"required"` // 内网ip范围段 ListenPort int `json:"listenPort" form:"listenPort" binding:"required"` // 监听端口 + PrivateKey string `json:"privateKey" form:"privateKey"` // 私钥 + PublicKey string `json:"publicKey" form:"publicKey"` // 密钥 PostUpScript string `json:"postUpScript" form:"postUpScript" binding:"omitempty"` PreDownScript string `json:"preDownScript" form:"preDownScript" binding:"omitempty"` PostDownScript string `json:"postDownScript" form:"postDownScript" binding:"omitempty"`