Selaa lähdekoodia

:art: 记录操作系统平台

Liang Ding 2 vuotta sitten
vanhempi
commit
a6d945a9a1
3 muutettua tiedostoa jossa 11 lisäystä ja 8 poistoa
  1. 4 4
      kernel/mobile/kernel.go
  2. 3 3
      kernel/util/os_mobile.go
  3. 4 1
      kernel/util/runtime.go

+ 4 - 4
kernel/mobile/kernel.go

@@ -18,13 +18,13 @@ package mobile
 
 import (
 	"fmt"
-	"github.com/siyuan-note/siyuan/kernel/cache"
-	"github.com/siyuan-note/siyuan/kernel/job"
 	"os"
 	"path/filepath"
 	"strings"
 	"time"
 
+	"github.com/siyuan-note/siyuan/kernel/cache"
+	"github.com/siyuan-note/siyuan/kernel/job"
 	"github.com/siyuan-note/siyuan/kernel/model"
 	"github.com/siyuan-note/siyuan/kernel/server"
 	"github.com/siyuan-note/siyuan/kernel/sql"
@@ -36,10 +36,10 @@ func StartKernelFast(container, appDir, workspaceBaseDir, localIPs string) {
 	go server.Serve(true)
 }
 
-func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang string) {
+func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang, osVer string) {
 	SetTimezone(container, appDir, timezoneID)
 	util.Mode = "prod"
-
+	util.MobileOSVer = osVer
 	util.LocalIPs = strings.Split(localIPs, ",")
 	util.BootMobile(container, appDir, workspaceBaseDir, lang)
 

+ 3 - 3
kernel/util/os_mobile.go

@@ -20,10 +20,10 @@ package util
 
 func GetOSPlatform() (plat, ver string) {
 	if ContainerIOS == Container {
-		return "iOS", ""
+		return "iOS", MobileOSVer
 	}
 	if ContainerAndroid == Container {
-		return "Android", ""
+		return "Android", MobileOSVer
 	}
-	return "Unknown", ""
+	return "Unknown", MobileOSVer
 }

+ 4 - 1
kernel/util/runtime.go

@@ -45,11 +45,14 @@ const (
 // IsExiting 是否正在退出程序。
 var IsExiting = false
 
+// MobileOSVer 移动端操作系统版本。
+var MobileOSVer string
+
 func logBootInfo() {
 	plat, platVer := GetOSPlatform()
 	osInfo := plat
 	if "" != platVer {
-		osInfo += "/" + platVer
+		osInfo += " " + platVer
 	}
 	logging.LogInfof("kernel is booting:\n"+
 		"    * ver [%s]\n"+