link 2 年之前
父节点
当前提交
f48cddf924
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 4 3
      model/sys_common.go
  2. 7 0
      route/init.go

+ 4 - 3
model/sys_common.go

@@ -70,7 +70,8 @@ type FileSetting struct {
 	DownloadDir string   `json:"download_dir"`
 	DownloadDir string   `json:"download_dir"`
 }
 }
 type BaseInfo struct {
 type BaseInfo struct {
-	Hash    string `json:"i"`
-	Version string `json:"v"`
-	Channel string `json:"c,omitempty"`
+	Hash       string `json:"i"`
+	Version    string `json:"v"`
+	Channel    string `json:"c,omitempty"`
+	DriveModel string `json:"m,omitempty"`
 }
 }

+ 7 - 0
route/init.go

@@ -17,6 +17,7 @@ import (
 	"strings"
 	"strings"
 	"time"
 	"time"
 
 
+	file1 "github.com/IceWhaleTech/CasaOS-Common/utils/file"
 	"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
 	"github.com/IceWhaleTech/CasaOS-Common/utils/logger"
 	"github.com/IceWhaleTech/CasaOS/common"
 	"github.com/IceWhaleTech/CasaOS/common"
 	"github.com/IceWhaleTech/CasaOS/model"
 	"github.com/IceWhaleTech/CasaOS/model"
@@ -53,6 +54,12 @@ func InitInfo() {
 	}
 	}
 	mb.Hash = encryption.GetMD5ByStr(mac)
 	mb.Hash = encryption.GetMD5ByStr(mac)
 	mb.Version = common.VERSION
 	mb.Version = common.VERSION
+	osRelease, _ := file1.ReadOSRelease()
+
+	mb.DriveModel = osRelease["MODEL"]
+	if len(mb.DriveModel) == 0 {
+		mb.DriveModel = "Casa"
+	}
 	os.Remove(config.AppInfo.DBPath + "/baseinfo.conf")
 	os.Remove(config.AppInfo.DBPath + "/baseinfo.conf")
 	by, err := json.Marshal(mb)
 	by, err := json.Marshal(mb)
 	if err != nil {
 	if err != nil {