fix: 注册 PUT /api/manager/settings 使设置保存生效

server.go NewServeMux 按方法分发到 handleSettingsPut(原仅注册 GET,PUT 静默返回旧值)

新增 TestSettingsPutRoundTrip 回归测试;gofmt 清理历史格式问题
This commit is contained in:
2026-08-17 12:00:34 +08:00
parent 1cd0ab8ad1
commit 5237e3b594
5 changed files with 66 additions and 22 deletions

View File

@ -24,7 +24,7 @@ type Local struct {
type Remote struct {
Name string `json:"name"`
IP string `json:"ip"`
Port int `json:"port"` // port to connect to frps
Port int `json:"port"` // port to connect to frps
Token string `json:"token,omitempty"`
URL string `json:"url,omitempty"`
Enabled bool `json:"enabled"`
@ -32,7 +32,7 @@ type Remote struct {
// Link connects one local to one remote.
type Link struct {
ID int64 `json:"id,omitempty"`
ID int64 `json:"id,omitempty"`
Local string `json:"local"`
Remote string `json:"remote"`
RemotePort int `json:"remotePort"`