This commit is contained in:
francis-fh
2026-06-09 15:42:15 +08:00
parent 23d5161904
commit f95981ed08

View File

@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
/**
@@ -55,13 +56,14 @@ public class AppScriptController extends BaseController
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
String fileName = null;
String fileName;
try {
fileName = FileUploadUtils.upload(filePath, file);
} catch (IOException e) {
error("读取文件出错");
logger.error("读取文件出错", e);
return error("文件上传失败:" + e.getMessage());
}
String path = filePath + fileName.replace("profile/upload/", "");
String path = filePath + File.separator + fileName.replace("profile/upload/", "");
jobService.importRow(path);
return success();
}