111
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user