Spring Cloud
ouyang_x
这个作者很懒,什么都没留下…
展开
-
项目在测试环境启动,报空间不足
@Bean MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setLocation("/app/upload_tmp"); return factory.createMultipartConfig(); } 在启动类中加上该配置原创 2021-10-14 08:36:21 · 65 阅读 · 0 评论 -
springBoot出现跨域问题,使用JSONP只能解决GET请求
前端使用JSONP解决跨域只能解决GET请求的 这时候,后端可以使用CORS解决(Cross-origin resource sharing)跨域问题 通过使用实现webMvcConfigurer接口,重写addCorsMappings方式来解决跨域问题 @Configuration public class CorsConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry原创 2021-03-31 08:55:34 · 172 阅读 · 0 评论 -
在springCloud中使用FeignClient会导致文件流格式错误
在springCloud中使用FeignClient会导致文件流格式错误,只需要把传入的参数加上对应的注解 @FeignClient(value = "dmr-service-con" , path = "/con/conBase", **configuration = MultipartSupportConfig.class** ) public interface LegalC...原创 2020-03-16 16:42:13 · 332 阅读 · 0 评论 -
springcloud 导入文件流还有参数
有个需要需要导入文件,同时还需要传入参数,在网上找了许久,都没有找到解决方法,又说@RequestBody ,还有用@RequestPart都试过没有用,直接报错,最后想到使用post请求,在方法上加HttpServletRequest servletRequest ,参数都从HttpServletRequest 中取出 获取文件流 MultipartFile file = null; ...原创 2020-03-16 16:39:02 · 402 阅读 · 0 评论 -
Spring Cloud 多环境配置,不同的环境不同的参数配置
先在pom文件中加入需要的对应环境 local <profiles.active>local</profiles.active> true dev <profiles.active>dev</profiles.active> sit <profiles.active>sit</profiles.ac...原创 2019-10-18 11:01:30 · 1085 阅读 · 0 评论