mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 调整网络请求超时为 30s Fix https://github.com/siyuan-note/siyuan/issues/6791
设置代理切换时不再需要重启 https://github.com/siyuan-note/siyuan/issues/6787
This commit is contained in:
parent
34c7fd5171
commit
7a3755daa1
4 changed files with 10 additions and 0 deletions
|
|
@ -368,6 +368,7 @@ func setNetworkProxy(c *gin.Context) {
|
||||||
|
|
||||||
proxyURL := model.Conf.System.NetworkProxy.String()
|
proxyURL := model.Conf.System.NetworkProxy.String()
|
||||||
util.SetNetworkProxy(proxyURL)
|
util.SetNetworkProxy(proxyURL)
|
||||||
|
util.PushMsg(model.Conf.Language(102), 3000)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addUIProcess(c *gin.Context) {
|
func addUIProcess(c *gin.Context) {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/siyuan-note/httpclient"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/88250/gulu"
|
"github.com/88250/gulu"
|
||||||
|
|
@ -48,3 +50,8 @@ func JsonArg(c *gin.Context, result *gulu.Result) (arg map[string]interface{}, o
|
||||||
ok = true
|
ok = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func initHttpClient() {
|
||||||
|
http.DefaultClient = httpclient.GetCloudFileClient2Min()
|
||||||
|
http.DefaultTransport = httpclient.NewTransport(false)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ func Boot() {
|
||||||
IncBootProgress(3, "Booting...")
|
IncBootProgress(3, "Booting...")
|
||||||
rand.Seed(time.Now().UTC().UnixNano())
|
rand.Seed(time.Now().UTC().UnixNano())
|
||||||
initMime()
|
initMime()
|
||||||
|
initHttpClient()
|
||||||
|
|
||||||
workspacePath := flag.String("workspace", "", "dir path of the workspace, default to ~/Documents/SiYuan/")
|
workspacePath := flag.String("workspace", "", "dir path of the workspace, default to ~/Documents/SiYuan/")
|
||||||
wdPath := flag.String("wd", WorkingDir, "working directory of SiYuan")
|
wdPath := flag.String("wd", WorkingDir, "working directory of SiYuan")
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l
|
||||||
IncBootProgress(3, "Booting...")
|
IncBootProgress(3, "Booting...")
|
||||||
rand.Seed(time.Now().UTC().UnixNano())
|
rand.Seed(time.Now().UTC().UnixNano())
|
||||||
initMime()
|
initMime()
|
||||||
|
initHttpClient()
|
||||||
|
|
||||||
HomeDir = filepath.Join(workspaceDir, "home")
|
HomeDir = filepath.Join(workspaceDir, "home")
|
||||||
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")
|
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue