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.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,13 +56,14 @@ public class AppScriptController extends BaseController
|
|||||||
// 上传文件路径
|
// 上传文件路径
|
||||||
String filePath = RuoYiConfig.getUploadPath();
|
String filePath = RuoYiConfig.getUploadPath();
|
||||||
// 上传并返回新文件名称
|
// 上传并返回新文件名称
|
||||||
String fileName = null;
|
String fileName;
|
||||||
try {
|
try {
|
||||||
fileName = FileUploadUtils.upload(filePath, file);
|
fileName = FileUploadUtils.upload(filePath, file);
|
||||||
} catch (IOException e) {
|
} 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);
|
jobService.importRow(path);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user