2.6-Preview最后一批代码上线
This commit is contained in:
@@ -188,6 +188,11 @@ func UpdateConfigHandler(c *gin.Context) {
|
||||
}
|
||||
cfg.TcpMux = true
|
||||
|
||||
// AdminPort 已从 JSON 绑定,直接使用
|
||||
if cfg.AdminPort <= 0 {
|
||||
cfg.AdminPort = 7400 // 如果前端没传,默认 7400
|
||||
}
|
||||
|
||||
if err := db.UpdateGlobalConfig(&cfg); err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"code": 2, "msg": "更新配置失败: " + err.Error()})
|
||||
return
|
||||
|
||||
@@ -95,6 +95,7 @@ const defaultConfig = {
|
||||
serverAddr: "frp.example.com",
|
||||
serverPort: 7000,
|
||||
token: "CHANGE_ME",
|
||||
adminPort: 7400,
|
||||
logLevel: "info",
|
||||
logMaxDays: 3,
|
||||
tcpMux: true,
|
||||
|
||||
@@ -201,6 +201,10 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label>管理端口 (admin_port)</label>
|
||||
<input type="number" v-model="globalConfig.adminPort" placeholder="7400" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user