feat: 解决首页获取不到芯片型号导致显示错误的BUG

This commit is contained in:
zhengkunwang223 2023-02-02 15:08:42 +08:00 committed by zhengkunwang223
parent 2d3fce1d3e
commit 03f2d0e352

View File

@ -82,10 +82,10 @@ func (u *DashboardService) LoadBaseInfo(ioOption string, netOption string) (*dto
baseInfo.CronjobNumber = len(cornjobs)
cpuInfo, err := cpu.Info()
if err != nil {
return nil, err
if err == nil {
baseInfo.CPUModelName = cpuInfo[0].ModelName
}
baseInfo.CPUModelName = cpuInfo[0].ModelName
baseInfo.CPUCores, _ = cpu.Counts(false)
baseInfo.CPULogicalCores, _ = cpu.Counts(true)