pox引入:
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>3.13.2</version>
</dependency>
实现方法:
@RequestMapping("/sysInfo")
public String sysInfo(Model retmodel) {
try {
Server server = new Server();
server.copyTo();
retmodel.addAttribute("server", server);
} catch (Exception e) {
e.printStackTrace();
}
return "webmanage/sysinfo/versionInfo";
}
工具类及实体类:
链接:https://pan.baidu.com/s/1f6LHxLzngCAkpahT-RX0Hg
提取码:0rwr
效果: