feat: 文件加解密放开onlyOffice相关一切接口

This commit is contained in:
2024-02-05 14:41:55 +08:00
parent 7b053acc19
commit 8e67fcb075
2 changed files with 11 additions and 0 deletions
@@ -47,6 +47,9 @@ public class DownloadDecryptFileServiceImpl implements DownloadDecryptFileServic
@Value("#{'${download.enable}'}")
private boolean enable;
@Value("#{'${download.white_url}'.split(',')}")
private List<String> whiteUrls;
/**
* 管理员角色
*/
@@ -90,6 +93,13 @@ public class DownloadDecryptFileServiceImpl implements DownloadDecryptFileServic
if(!enable){
return;
}
// 白名单不执行
String requestUrl = request.getRequestURI();
for (String whiteUrl : whiteUrls) {
if (requestUrl.contains(whiteUrl)) {
return;
}
}
// 判断返回值是否为文件流,否则其他接口返回值会变更成字符串,导致前端无法解析
HandlerMethod handlerMethod = (HandlerMethod) handler;
InputStream responseBody = null;