优化部分代码

This commit is contained in:
chuzhongzai 2023-12-20 23:21:25 +08:00
parent 9155cb27a6
commit 9a31a4593b
2 changed files with 6 additions and 10 deletions

View File

@ -32,7 +32,7 @@
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
</dependency>
<dependency>
@ -58,7 +58,7 @@
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
<scope>test</scope>
</dependency>

View File

@ -61,15 +61,11 @@ public class IoUtil {
cpuInfo = OshiUtil.getCpuInfo();
globalMemory = OshiUtil.getMemory();
for (NetworkIF nif : networkIFs) {
if (SystemUtil.getOsInfo().isLinux()) {
if (nif.getName().equals("eth0") || nif.getName().equals("ens33"))
networkIF = nif;
} else if (nif.getName().equals("eth4") || nif.getName().equals("ethernet_32769"))
for (NetworkIF nif : networkIFs)
if (nif.getName().startsWith("eth") || nif.getName().startsWith("ens")) {
networkIF = nif;
}
break;
}
if(networkIF == null)
log.error("网卡 eth0 不存在");