解决办法:跨域配置报错,将将.allowedOrigins替换成.allowedOriginPatterns即可。

@Configuration
public class CrosConfig implements WebMvcConfigurer {@Overridepublic void addCorsMappings(CorsRegistry registry) {//拿过来粘贴一波,跨域问题就解决了/*** 意思就是,无论你请求我8181(本项目端口)的什么服务,* 而且是GET、HEAD、POST等几种请求的类型都可以*/// 设置允许跨域的路由registry.addMapping("/**")// 设置允许跨域请求的域名.allowedOriginPatterns("*")// 是否允许证书(cookies).allowCredentials(true)// 设置允许的方法.allowedMethods("*")// 跨域允许时间.maxAge(3600);}
}

解决跨域问题报错When allowCredentials is true, allowedOrigins cannot contain the special value “*“ since tha相关推荐

  1. Springboot跨域配置报错:When allowCredentials is true, allowedOrigins cannot contain the specia

    错误信息为: When allowCredentials is true, allowedOrigins cannot contain thespecial value "*"si ...

  2. When allowCredentials is true, allowedOrigins cannot contain the special value “*“ that cannot be

    SpringBoot升级2.4.0所出现的问题: When allowCredentials is true, allowedOrigins cannot contain the special va ...

  3. 报错:uni-app跨域请求报错

    编辑器:HBuilderX 语言架构:uni-app + uview+ luch-Request 报错情况:本地运行后端 jar 包,列表页面访问没有问题,打开子组件详情页却跨域错误.但是换台电脑的情 ...

  4. Vue 跨域请求报错No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.

    坑是一个一个踩出来的... 报错如下: Access to XMLHttpRequest at 'http://apps.eshimin.com/traffic/gjc/getArriveBase?n ...

  5. Js 跨域CORS报错 Response for preflight has invalid HTTP status code 405

    调用接口遇到Response for preflight has invalid HTTP status code 405这样的错误,是使用PUT方式提交请求接口.Content-Type设置为app ...

  6. Springboot 解决跨域的四种姿势

    Springboot 解决跨域的四种姿势 姿势一 实现WebMvcConfigurer#addCorsMappings的方法 import org.springframework.context.an ...

  7. 跨域 问题:When allowCredentials is true, allowedOrigins cannot contain the specia

    解决办法:跨域配置报错,将.allowedOrigins替换成.allowedOriginPatterns即可. 修改前 @Configuration public class WebMvcConfi ...

  8. When allowCredentials is true, allowedOrigins cannot contain the specia 跨域 网关跨域

    解决办法:跨域配置报错,将.allowedOrigins替换成.allowedOriginPatterns即可. SpringBoot2.0.0中 @Configuration public clas ...

  9. SpringBoot解决跨域问题的六种方式

    一.同源策略 同源,就是咱们域名.端口号.ip.采用的协议都相同,那么我们就是同源的 反之就是不同源的!!! 出于浏览器的同源策略限制.同源策略(Sameoriginpolicy)是一种约定,它是浏览 ...

  10. java跨系统和跨域_java web服务解决跨域问题

    问题1:浏览器页面跨域请求报错 相信很多程序员都遇到过跨域的问题,如何解决一直是一件很头疼的事情,我就描述下我遇到的问题,及解决办法.什么是跨域,请自行脑补. 需要添加maven依赖,在web.xml ...

最新文章

  1. wpf控件设计时支持(2)
  2. 【记录】常用的vim插件及配置和使用
  3. elasticsearch简单操作(一)
  4. linux - 虚拟机的自动安装与dhcp
  5. CLOUD配置审批流发消息
  6. 文件解析漏洞总结-Apache
  7. PMP - 考试将于2011年8月31日更新
  8. 用户访问共享计算机没有权限,win7共享没有权限访问 共享文件访问权限的方法...
  9. avue中怎样隐藏新增和编辑的按钮
  10. idea数据库反向生成实体类_asp.net core 系列 21 EF现有数据库进行反向工程
  11. html柳树动画,3D教程-柳树生长动画
  12. Android7.0关机流程分析
  13. Java 使用SAX解析XML文档
  14. 如何在AngularJS中有条件地应用CSS样式?
  15. python-Django 增删改和分页
  16. Java字符流拷贝/复制文本文件,字节流拷贝文本文件乱码,很经典简便
  17. kdj买卖指标公式源码_优化kdj买卖指标公式
  18. 三维匹配_多视图几何三维重建实战系列之COLMAP
  19. RocketMQ消费失败重试机制分析
  20. 【Paper】ConvLSTM:Convolutional LSTM Network: A Machine Learning Approach for Precipitation Nowcasting

热门文章

  1. TypeScript 导出 Excel 表格(带斑马纹样式)
  2. Linux中rps/rfs的原理及实现
  3. android点击vcf文件,Android vcard使用示例,生成vcf文件
  4. 基础知识之存活探针(Liveness Probe)
  5. 转福布斯荐75本经商必读
  6. win10内存满载测试软件,windows10系统使用自带内存检测工具检测内存好坏的方法...
  7. Http 417错误
  8. Falsy Bouncer 过滤数组假值
  9. php手机网页唤醒支付宝APP支付,支付宝H5唤醒APP
  10. iOS 支付宝手机网站支付