优化部分代码

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

View File

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