当实现前后端分离,前端调用接口,浏览器给出的错误
Access to XMLHttpRequest at 'http://192.168.31.30:8000/Host/'
from origin 'http://localhost:8080'
has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
意思就是说,所请求的资源没有Access-Control-Allow-Origin
- 带上标头-即可解决
get.addHeader( "Access-Control-Allow-Origin","*");//允许所有来源访同
get.addHeader( "Access-Control-Allow-Method","POST,GET");//允许访问的方式
- 使用浏览器插件快速解决
插件就帮我们处理好了
最新评论
# 这只是一个创建远程登录并授权的语句、仅作为记录 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Fit2cloud!' WITH GRANT OPTION;
当MGR集群初始化结束后,需要开启MGR集群自启动(需要有一台节点是自动开启引导) loose-group_replication_start_on_boot = ON #设置节点是否在启动时自动启动 MGR 集群 loose-group_replication_bootstrap_group = ON #设置节点是否作为初始引导节点启动集群
密码:blog.sirliu.com
本内容密码:blog.sirliu.com 最新整理的文章在这里喔:https://blog.sirliu.com/2018/11/shell_lian_xi_ti.html