1
13693261870
2024-10-14 a6fe405947004d6571806edabd8f14357e144cfa
src/main/java/com/se/simu/helper/WebHelper.java
@@ -31,10 +31,23 @@
    private final static String UNKNOWN = "unknown";
    public static boolean isWin() {
        String osName = System.getProperty("os.name");
        return osName.startsWith("Windows");
    }
    /**
     * 格式化当前系统日期 4
     * 获取CPU核心数
     */
    public static final SimpleDateFormat YMDHMS = new SimpleDateFormat("yyyyMMddHHmmss");
    public static int getCpuCores() {
        return Runtime.getRuntime().availableProcessors();
    }
    /**
     * 格式化日期
     */
    public final static SimpleDateFormat YMDHMS = new SimpleDateFormat("yyyyMMddHHmmss");
    /**
     * 字符串,是否为空null和空格
@@ -52,8 +65,6 @@
    /**
     * 获取主机IP
     *
     * @return
     */
    public static String getHostIp() {
        try {
@@ -212,7 +223,6 @@
            res.setStatus(HttpStatus.NOT_FOUND.value());
            return;
        }
        String fileName = URLEncoder.encode(filePath, "UTF-8").replace("+", "%20");
        res.setHeader("Content-Disposition", "attachment; filename*=UTF-8''" + fileName);