feat: 文件加解密放开onlyOffice相关一切接口
This commit is contained in:
+10
@@ -47,6 +47,9 @@ public class DownloadDecryptFileServiceImpl implements DownloadDecryptFileServic
|
|||||||
@Value("#{'${download.enable}'}")
|
@Value("#{'${download.enable}'}")
|
||||||
private boolean enable;
|
private boolean enable;
|
||||||
|
|
||||||
|
@Value("#{'${download.white_url}'.split(',')}")
|
||||||
|
private List<String> whiteUrls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理员角色
|
* 管理员角色
|
||||||
*/
|
*/
|
||||||
@@ -90,6 +93,13 @@ public class DownloadDecryptFileServiceImpl implements DownloadDecryptFileServic
|
|||||||
if(!enable){
|
if(!enable){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 白名单不执行
|
||||||
|
String requestUrl = request.getRequestURI();
|
||||||
|
for (String whiteUrl : whiteUrls) {
|
||||||
|
if (requestUrl.contains(whiteUrl)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
// 判断返回值是否为文件流,否则其他接口返回值会变更成字符串,导致前端无法解析
|
// 判断返回值是否为文件流,否则其他接口返回值会变更成字符串,导致前端无法解析
|
||||||
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
||||||
InputStream responseBody = null;
|
InputStream responseBody = null;
|
||||||
|
|||||||
@@ -447,6 +447,7 @@ download:
|
|||||||
# 文件下载、预览拦截路径,多个以逗号分隔
|
# 文件下载、预览拦截路径,多个以逗号分隔
|
||||||
download_url: /sys/common/download/
|
download_url: /sys/common/download/
|
||||||
view_url: /sys/common/view/
|
view_url: /sys/common/view/
|
||||||
|
white_url: /onlyOffice
|
||||||
# 管理员角色
|
# 管理员角色
|
||||||
admin_role_code: admin,BZGLY
|
admin_role_code: admin,BZGLY
|
||||||
# 加密参数
|
# 加密参数
|
||||||
|
|||||||
Reference in New Issue
Block a user