|
|
@@ -177,13 +177,16 @@ public class DocInfoController extends BaseController {
|
|
|
if (info == null) {
|
|
|
return error("该文件已失效!");
|
|
|
}
|
|
|
+
|
|
|
String ext = info.getFileType();
|
|
|
- //因为数据库存的是带 . 的,所以要先截取掉这个 .
|
|
|
- ext = ext.substring(1);
|
|
|
- if (Arrays.asList(Constants.ALLOW_EDIT).contains(ext)) {
|
|
|
- //判断是否 onlyoffice允许的可编辑文件格式,如果是,则需要复制一份,如果不是就不管
|
|
|
- DocumentVO vo = mongoService.copy(info.getFileId());
|
|
|
- info.setFileId(vo.getFileId());
|
|
|
+ if (StringUtils.isNotEmpty(ext)) {
|
|
|
+ //因为数据库存的是带 . 的,所以要先截取掉这个 .
|
|
|
+ ext = ext.substring(1);
|
|
|
+ if (Arrays.asList(Constants.ALLOW_EDIT).contains(ext)) {
|
|
|
+ //判断是否 onlyoffice允许的可编辑文件格式,如果是,则需要复制一份,如果不是就不管
|
|
|
+ DocumentVO vo = mongoService.copy(info.getFileId());
|
|
|
+ info.setFileId(vo.getFileId());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
info.setDocId(null);
|
|
|
@@ -192,7 +195,7 @@ public class DocInfoController extends BaseController {
|
|
|
info.setFileName(info.getFileName());
|
|
|
docInfoService.insertDocInfo(info);
|
|
|
|
|
|
- return success();
|
|
|
+ return success(info);
|
|
|
}
|
|
|
|
|
|
|