Merge branch 'master' into dev/1078-newUI

# Conflicts:
#	src/main/resources/application.yml
This commit is contained in:
648540858
2025-05-10 08:59:45 +08:00
378 changed files with 48292 additions and 475 deletions

View File

@@ -1,6 +1,7 @@
package com.genersoft.iot.vmp.utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.DigestUtils;
import oshi.SystemInfo;
import oshi.hardware.CentralProcessor;
import oshi.hardware.GlobalMemory;
@@ -9,6 +10,7 @@ import oshi.hardware.NetworkIF;
import oshi.software.os.OperatingSystem;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -142,4 +144,19 @@ public class SystemInfoUtils {
}
return result;
}
public static String getHardwareId(){
SystemInfo systemInfo = new SystemInfo();
HardwareAbstractionLayer hardware = systemInfo.getHardware();
// CPU ID
String cpuId = hardware.getProcessor().getProcessorIdentifier().getProcessorID();
// 主板序号
String serialNumber = hardware.getComputerSystem().getSerialNumber();
return DigestUtils.md5DigestAsHex(
(
DigestUtils.md5DigestAsHex(cpuId.getBytes(StandardCharsets.UTF_8)) +
DigestUtils.md5DigestAsHex(serialNumber.getBytes(StandardCharsets.UTF_8))
).getBytes(StandardCharsets.UTF_8));
}
}