From efb6a2801dca933309bbb43371024c627dc421d8 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 25 Oct 2022 11:55:42 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=A1=8C=E9=9D=A2=E7=AB=AF=E5=86=85?= =?UTF-8?q?=E6=A0=B8=E8=BF=9B=E7=A8=8B=E4=BD=BF=E7=94=A8=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/4952?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 2 +- kernel/util/working.go | 4 +++- kernel/util/working_mobile.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 054406d8b..f652a94ec 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -275,7 +275,7 @@ func InitConf() { Conf.System.FixedPort = true } if Conf.System.FixedPort { - util.ServerPort = "6806" + util.ServerPort = util.FixedPort } Conf.LocalIPs = util.GetLocalIPs() diff --git a/kernel/util/working.go b/kernel/util/working.go index 220eb1674..7fef00fd1 100644 --- a/kernel/util/working.go +++ b/kernel/util/working.go @@ -79,7 +79,7 @@ func Boot() { Resident, _ = strconv.ParseBool(*resident) ServerPort = *port if isRunningInDockerContainer() || "dev" == Mode { - ServerPort = "6806" + ServerPort = FixedPort } ReadOnly, _ = strconv.ParseBool(*readOnly) AccessAuthCode = *accessAuthCode @@ -291,6 +291,8 @@ const ( ContainerDocker = "docker" // Docker 容器端 ContainerAndroid = "android" // Android 端 ContainerIOS = "ios" // iOS 端 + + FixedPort = "6806" // 固定端口 ) func initPathDir() { diff --git a/kernel/util/working_mobile.go b/kernel/util/working_mobile.go index 82ae0c789..0f98a2dc4 100644 --- a/kernel/util/working_mobile.go +++ b/kernel/util/working_mobile.go @@ -61,7 +61,7 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l ThemesPath = filepath.Join(AppearancePath, "themes") IconsPath = filepath.Join(AppearancePath, "icons") Resident = true - ServerPort = "6806" + ServerPort = FixedPort Container = container UserAgent = UserAgent + " " + Container httpclient.SetUserAgent(UserAgent)