Browse Source

框架漏洞

master
467010279@qq.com 6 days ago
parent
commit
e59ec0aa29
  1. 14
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java
  2. 8
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java

14
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/SwaggerController.java

@ -8,17 +8,17 @@ import com.ruoyi.common.core.controller.BaseController; @@ -8,17 +8,17 @@ import com.ruoyi.common.core.controller.BaseController;
/**
* swagger 接口
*
*
* @author ruoyi
*/
@Controller
@RequestMapping("/tool/swagger")
public class SwaggerController extends BaseController
{
@PreAuthorize("@ss.hasPermi('tool:swagger:view')")
@GetMapping()
public String index()
{
return redirect("/swagger-ui.html");
}
// @PreAuthorize("@ss.hasPermi('tool:swagger:view')")
// @GetMapping()
// public String index()
// {
// return redirect("/swagger-ui.html");
// }
}

8
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java

@ -15,7 +15,7 @@ import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor; @@ -15,7 +15,7 @@ import com.ruoyi.framework.interceptor.RepeatSubmitInterceptor;
/**
* 通用配置
*
*
* @author ruoyi
*/
@Configuration
@ -32,8 +32,8 @@ public class ResourcesConfig implements WebMvcConfigurer @@ -32,8 +32,8 @@ public class ResourcesConfig implements WebMvcConfigurer
.addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
/** swagger配置 */
registry.addResourceHandler("/swagger-ui/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
// registry.addResourceHandler("/swagger-ui/**")
// .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
}
/**
@ -67,4 +67,4 @@ public class ResourcesConfig implements WebMvcConfigurer @@ -67,4 +67,4 @@ public class ResourcesConfig implements WebMvcConfigurer
// 返回新的CorsFilter
return new CorsFilter(source);
}
}
}

Loading…
Cancel
Save