feat: 在线编辑创建空文件并映射外部
This commit is contained in:
@@ -38,6 +38,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
|
|||||||
private String webAppPath;
|
private String webAppPath;
|
||||||
@Value("${spring.resource.static-locations}")
|
@Value("${spring.resource.static-locations}")
|
||||||
private String staticLocations;
|
private String staticLocations;
|
||||||
|
@Value("${file.path}")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 静态资源的配置 - 使得可以从磁盘中读取 Html、图片、视频、音频等
|
* 静态资源的配置 - 使得可以从磁盘中读取 Html、图片、视频、音频等
|
||||||
@@ -47,6 +49,10 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
|
|||||||
registry.addResourceHandler("/**")
|
registry.addResourceHandler("/**")
|
||||||
.addResourceLocations("file:" + upLoadPath + "//", "file:" + webAppPath + "//")
|
.addResourceLocations("file:" + upLoadPath + "//", "file:" + webAppPath + "//")
|
||||||
.addResourceLocations(staticLocations.split(","));
|
.addResourceLocations(staticLocations.split(","));
|
||||||
|
|
||||||
|
// 映射在线编辑文件存储路径
|
||||||
|
registry.addResourceHandler("/file/**")
|
||||||
|
.addResourceLocations("file:" + filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ public class ShiroConfig {
|
|||||||
|
|
||||||
//onlyoffice排除
|
//onlyoffice排除
|
||||||
filterChainDefinitionMap.put("/onlyOffice/**", "anon");
|
filterChainDefinitionMap.put("/onlyOffice/**", "anon");
|
||||||
|
filterChainDefinitionMap.put("/file/**", "anon");
|
||||||
|
|
||||||
//对接接口排除
|
//对接接口排除
|
||||||
filterChainDefinitionMap.put("/sync/**", "anon");
|
filterChainDefinitionMap.put("/sync/**", "anon");
|
||||||
|
|||||||
-1
@@ -301,7 +301,6 @@ public class OnlyOfficeController {
|
|||||||
@ApiOperation(value = "|model| 传入 模板文档名称(不带后缀)默认 docx")
|
@ApiOperation(value = "|model| 传入 模板文档名称(不带后缀)默认 docx")
|
||||||
@GetMapping("/saveEditFile")
|
@GetMapping("/saveEditFile")
|
||||||
public Result<BusProcessModelHis> saveEditFile(String model) {
|
public Result<BusProcessModelHis> saveEditFile(String model) {
|
||||||
|
|
||||||
return Result.OK(busProcessModelHisService.saveEditFile(model));
|
return Result.OK(busProcessModelHisService.saveEditFile(model));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -57,11 +57,9 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
|||||||
String taskId = "task_" + changUuid;
|
String taskId = "task_" + changUuid;
|
||||||
String topId = "top_" + changUuid;
|
String topId = "top_" + changUuid;
|
||||||
|
|
||||||
StringBuilder builderModel = new StringBuilder();
|
String builderModel = "model" + "/";
|
||||||
builderModel.append("model").append("/");
|
|
||||||
builderModel.append("model").append("/");
|
|
||||||
|
|
||||||
File dir = new File(filePath + builderModel.toString());
|
File dir = new File(filePath + builderModel);
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
dir.mkdirs();
|
dir.mkdirs();
|
||||||
}
|
}
|
||||||
@@ -86,6 +84,7 @@ public class BusProcessModelHisServiceImpl extends ServiceImpl<BusProcessModelHi
|
|||||||
modelHis.setTaskId(taskId);
|
modelHis.setTaskId(taskId);
|
||||||
modelHis.setPId(topId);
|
modelHis.setPId(topId);
|
||||||
modelHis.setEditFilePath(targetPath);
|
modelHis.setEditFilePath(targetPath);
|
||||||
|
modelHis.setDownLoadUrl(downloadUrl + targetPath);
|
||||||
this.baseMapper.insert(modelHis);
|
this.baseMapper.insert(modelHis);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
|
|||||||
@@ -376,11 +376,11 @@ justauth:
|
|||||||
timeout: 1h
|
timeout: 1h
|
||||||
|
|
||||||
file:
|
file:
|
||||||
downloadUrl: a
|
downloadUrl: http://localhost:8184/laws-sinotruk/file/
|
||||||
split:
|
split:
|
||||||
path: D://opt//onlyoffice//file//splitImage/
|
path: D://opt//onlyOffice//file//splitImage//
|
||||||
sourceFilePath: D://opt//onlyoffice//sourceFile//DOCX.docx
|
sourceFilePath: D://opt//onlyOffice//DOCX.docx
|
||||||
path: D://opt//onlyoffice//file//
|
path: D:/opt/onlyOffice/file/
|
||||||
|
|
||||||
iam:
|
iam:
|
||||||
bimRemoteUser: srmsIam
|
bimRemoteUser: srmsIam
|
||||||
|
|||||||
@@ -349,11 +349,11 @@ justauth:
|
|||||||
timeout: 1h
|
timeout: 1h
|
||||||
|
|
||||||
file:
|
file:
|
||||||
downloadUrl: a
|
downloadUrl: http://localhost:8184/laws-sinotruk/file/
|
||||||
split:
|
split:
|
||||||
path: /opt/onlyoffice/file/splitImage/
|
path: /opt/onlyOffice/file/splitImage/
|
||||||
sourceFilePath: /app/onlyoffice/DOCX.docx
|
sourceFilePath: /opt/onlyOffice/DOCX.docx
|
||||||
path: /app/onlyoffice/file/
|
path: /opt/onlyOffice/file/
|
||||||
|
|
||||||
iam:
|
iam:
|
||||||
bimRemoteUser: srmsIam
|
bimRemoteUser: srmsIam
|
||||||
|
|||||||
Reference in New Issue
Block a user