mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🎨 桌面端内核进程使用随机端口 https://github.com/siyuan-note/siyuan/issues/4952
This commit is contained in:
parent
a20a19182b
commit
bb90e72eee
10 changed files with 50 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/system/getEmojiConf", model.CheckAuth, getEmojiConf)
|
||||
ginServer.Handle("POST", "/api/system/setAccessAuthCode", model.CheckAuth, setAccessAuthCode)
|
||||
ginServer.Handle("POST", "/api/system/setNetworkServe", model.CheckAuth, setNetworkServe)
|
||||
ginServer.Handle("POST", "/api/system/setFixedPort", model.CheckAuth, setFixedPort)
|
||||
ginServer.Handle("POST", "/api/system/setUploadErrLog", model.CheckAuth, setUploadErrLog)
|
||||
ginServer.Handle("POST", "/api/system/setDownloadInstallPkg", model.CheckAuth, setDownloadInstallPkg)
|
||||
ginServer.Handle("POST", "/api/system/setNetworkProxy", model.CheckAuth, setNetworkProxy)
|
||||
|
|
|
|||
|
|
@ -285,6 +285,23 @@ func setNetworkServe(c *gin.Context) {
|
|||
time.Sleep(time.Second * 3)
|
||||
}
|
||||
|
||||
func setFixedPort(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
fixedPort := arg["fixedPort"].(bool)
|
||||
model.Conf.FixedPort = fixedPort
|
||||
model.Conf.Save()
|
||||
|
||||
util.PushMsg(model.Conf.Language(42), 1000*15)
|
||||
time.Sleep(time.Second * 3)
|
||||
}
|
||||
|
||||
func setUploadErrLog(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue