@ -43,6 +43,7 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
Set<String> filterUri = new HashSet<>();
|
Set<String> filterUri = new HashSet<>();
|
||||||
filterUri.add("/onlinePreview");
|
filterUri.add("/onlinePreview");
|
||||||
filterUri.add("/picturesPreview");
|
filterUri.add("/picturesPreview");
|
||||||
|
filterUri.add("/getCorsFile");
|
||||||
TrustHostFilter filter = new TrustHostFilter();
|
TrustHostFilter filter = new TrustHostFilter();
|
||||||
FilterRegistrationBean<TrustHostFilter> registrationBean = new FilterRegistrationBean<>();
|
FilterRegistrationBean<TrustHostFilter> registrationBean = new FilterRegistrationBean<>();
|
||||||
registrationBean.setFilter(filter);
|
registrationBean.setFilter(filter);
|
||||||
|
|||||||
@ -75,7 +75,7 @@ public class DownloadUtils {
|
|||||||
response.setMsg(fileName);
|
response.setMsg(fileName);
|
||||||
return response;
|
return response;
|
||||||
} catch (IOException | GalimatiasParseException e) {
|
} catch (IOException | GalimatiasParseException e) {
|
||||||
logger.error("文件下载失败,url:{}", urlStr, e);
|
logger.error("文件下载失败,url:{}", urlStr);
|
||||||
response.setCode(1);
|
response.setCode(1);
|
||||||
response.setContent(null);
|
response.setContent(null);
|
||||||
if (e instanceof FileNotFoundException) {
|
if (e instanceof FileNotFoundException) {
|
||||||
|
|||||||
@ -42,7 +42,9 @@ public class TrustHostFilter implements Filter {
|
|||||||
response.getWriter().write(html);
|
response.getWriter().write(html);
|
||||||
response.getWriter().close();
|
response.getWriter().close();
|
||||||
}
|
}
|
||||||
chain.doFilter(request, response);
|
else {
|
||||||
|
chain.doFilter(request, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user