图片拦截修改
This commit is contained in:
parent
71104dd12c
commit
e637af8970
|
|
@ -65,7 +65,8 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
* 越权 放权的请求 指定的前缀 -公共的请求+数据接口
|
||||
*/
|
||||
public static String[] WHITE_URL=new String[]{"/sys/selected/","/dataCenter/inter/","/back/verify/"};
|
||||
|
||||
//图片默认放权
|
||||
public final static String images="JPG,PNG,JPEG,";
|
||||
/**
|
||||
* 越权白名单路径->指定的路径
|
||||
*/
|
||||
|
|
@ -144,6 +145,13 @@ public class ParamSecureHandler implements AsyncHandlerInterceptor {
|
|||
*/
|
||||
private boolean checkIsYq(HttpServletRequest request) throws Exception {
|
||||
String requestUri = request.getRequestURI();
|
||||
if(requestUri.contains(".")){
|
||||
String imageType=requestUri.substring(requestUri.lastIndexOf(".")+1).toUpperCase();
|
||||
if (images.contains(imageType)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(Arrays.asList(WHITE_URLS).contains(requestUri)){
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ public class ResponseEncryptFilter implements GlobalFilter, Ordered {
|
|||
*/
|
||||
public final static String KEY_HEAD="decrypt";
|
||||
|
||||
public final static String images="JPG,PNG,JPEG,";
|
||||
|
||||
/**忽略加密的参数的请求*/
|
||||
public static List<String> ignoreUrls = new ArrayList<>();
|
||||
|
||||
|
|
@ -61,8 +63,16 @@ public class ResponseEncryptFilter implements GlobalFilter, Ordered {
|
|||
log.info("============================ResponseEncryptFilter start===================================");
|
||||
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
URI uri = request.getURI();
|
||||
|
||||
String reqPath = request.getURI().getPath();
|
||||
if(reqPath.contains(".")){
|
||||
String imageType=reqPath.substring(reqPath.lastIndexOf(".")+1).toUpperCase();
|
||||
if (images.contains(imageType)){
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boolean sf = ignoreUrls.contains(reqPath);
|
||||
if(sf){
|
||||
return chain.filter(exchange);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public class ResourcesConfigAdapter extends WebMvcConfigurerAdapter {
|
|||
// registry.addResourceHandler("/files/**").addResourceLocations("file:/data/ahsbs/file/");
|
||||
// super.addResourceHandlers(registry);
|
||||
|
||||
registry.addResourceHandler("/files/**").addResourceLocations("file:D:\\file\\");
|
||||
registry.addResourceHandler("/files/**").addResourceLocations("file:F:\\File\\");
|
||||
super.addResourceHandlers(registry);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.sercurityControl.proteam.dutyTask.controller;
|
||||
|
||||
import com.securityControl.common.core.web.domain.AjaxResult;
|
||||
import com.securityControl.common.log.annotation.SysLog;
|
||||
import com.securityControl.common.log.enums.OperaType;
|
||||
import com.sercurityControl.proteam.dutyTask.domain.HistoryDto;
|
||||
import com.sercurityControl.proteam.dutyTask.service.HistoryService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -29,6 +31,7 @@ public class HistoryController {
|
|||
* @date 2024/1/25 15:28
|
||||
*/
|
||||
@PostMapping("getHistoryByDateType")
|
||||
@SysLog(title = "综合展示", model = "综合展示->综合展示", operaType = OperaType.EXPORT, details = "历史记录查询")
|
||||
public AjaxResult getHistoryByDateType(HistoryDto dto) {
|
||||
return service.getHistoryByDateType(dto);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue