Explorar o código

:art: 桌面端支持同时打开多个工作空间 https://github.com/siyuan-note/siyuan/issues/4567

Liang Ding %!s(int64=2) %!d(string=hai) anos
pai
achega
aabc1d4a85
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      kernel/server/serve.go

+ 4 - 0
kernel/server/serve.go

@@ -114,6 +114,10 @@ func Serve(fastMode bool) {
 	go func() {
 		time.Sleep(1 * time.Second)
 		if util.FixedPort != port {
+			if isPortOpen(util.FixedPort) {
+				return
+			}
+
 			// 启动一个 6806 端口的反向代理服务器,这样浏览器扩展才能直接使用 127.0.0.1:6806,不用配置端口
 			serverURL, _ := url.Parse("http://127.0.0.1:" + port)
 			proxy := httputil.NewSingleHostReverseProxy(serverURL)