| | |
| | | |
| | | /** |
| | | * 通用配置 |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Configuration |
| | |
| | | /** 本地文件上传路径 */ |
| | | registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**") |
| | | .addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); |
| | | // |
| | | // /** swagger配置 */ |
| | | // registry.addResourceHandler("/swagger-ui/**") |
| | | // .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") |
| | | // .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic()); |
| | | |
| | | /** swagger配置 */ |
| | | registry.addResourceHandler("/swagger-ui/**") |
| | | .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") |
| | | .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic()); |
| | | registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/favicon.ico").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | } |
| | | |
| | | /** |
| | |
| | | // 返回新的CorsFilter |
| | | return new CorsFilter(source); |
| | | } |
| | | } |
| | | } |