mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🐛 User Agent 初始化
This commit is contained in:
parent
d06ebab62f
commit
1888165108
3 changed files with 5 additions and 3 deletions
|
|
@ -219,7 +219,6 @@ func InitConf() {
|
||||||
Conf.System.WorkspaceDir = util.WorkspaceDir
|
Conf.System.WorkspaceDir = util.WorkspaceDir
|
||||||
Conf.System.DataDir = util.DataDir
|
Conf.System.DataDir = util.DataDir
|
||||||
Conf.System.Container = util.Container
|
Conf.System.Container = util.Container
|
||||||
util.UserAgent = util.UserAgent + " " + util.Container
|
|
||||||
Conf.System.OS = runtime.GOOS
|
Conf.System.OS = runtime.GOOS
|
||||||
Conf.Newbie = util.IsNewbie
|
Conf.Newbie = util.IsNewbie
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,6 @@ func Boot() {
|
||||||
IncBootProgress(3, "Booting...")
|
IncBootProgress(3, "Booting...")
|
||||||
rand.Seed(time.Now().UTC().UnixNano())
|
rand.Seed(time.Now().UTC().UnixNano())
|
||||||
initMime()
|
initMime()
|
||||||
httpclient.SetUserAgent(UserAgent)
|
|
||||||
|
|
||||||
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")
|
||||||
|
|
@ -84,6 +83,9 @@ func Boot() {
|
||||||
Container = "docker"
|
Container = "docker"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UserAgent = UserAgent + " " + Container
|
||||||
|
httpclient.SetUserAgent(UserAgent)
|
||||||
|
|
||||||
initWorkspaceDir(*workspacePath)
|
initWorkspaceDir(*workspacePath)
|
||||||
|
|
||||||
SSL = *ssl
|
SSL = *ssl
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ 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()
|
||||||
httpclient.SetUserAgent(UserAgent)
|
|
||||||
|
|
||||||
HomeDir = filepath.Join(workspaceDir, "home")
|
HomeDir = filepath.Join(workspaceDir, "home")
|
||||||
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")
|
userHomeConfDir := filepath.Join(HomeDir, ".config", "siyuan")
|
||||||
|
|
@ -61,6 +60,8 @@ func BootMobile(container, appDir, workspaceDir, nativeLibDir, privateDataDir, l
|
||||||
IconsPath = filepath.Join(AppearancePath, "icons")
|
IconsPath = filepath.Join(AppearancePath, "icons")
|
||||||
Resident = true
|
Resident = true
|
||||||
Container = container
|
Container = container
|
||||||
|
UserAgent = UserAgent + " " + Container
|
||||||
|
httpclient.SetUserAgent(UserAgent)
|
||||||
Lang = lang
|
Lang = lang
|
||||||
initPathDir()
|
initPathDir()
|
||||||
bootBanner := figure.NewFigure("SiYuan", "", true)
|
bootBanner := figure.NewFigure("SiYuan", "", true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue