修改漏洞问题-pc端已测试完成
This commit is contained in:
@@ -3,6 +3,7 @@ package com.ruoyi.cms.util;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook; // 改为XSSFWorkbook
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -17,7 +18,8 @@ public class ExcelToObject {
|
||||
public static <T> List<T> readExcelToObjects(String filePath, Class<T> clazz) throws Exception {
|
||||
List<T> resultList = new ArrayList<>();
|
||||
|
||||
try (FileInputStream fileInputStream = new FileInputStream(filePath);
|
||||
File safeFile =new File(filePath).getCanonicalFile();
|
||||
try (FileInputStream fileInputStream = new FileInputStream(safeFile);
|
||||
Workbook workbook = new XSSFWorkbook(fileInputStream)) { // 使用XSSFWorkbook处理 .xlsx 文件
|
||||
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
Reference in New Issue
Block a user