aurelia 跨域问题
来源:互联网 发布:sm是什么体验 知乎 编辑:程序博客网 时间:2024/06/05 23:02
XMLHttpRequest cannot load http://192.168.0.100:30755/api/values. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.0.101:8018' is therefore not allowed access.
aurelia 部署在
http://192.168.0.101:8018
数据来源地址
http://192.168.0.100:30755
aurelia 请求访问100:30755上面的数据就会有跨域问题也就是刚上面的错误
解决办法:
在0.100:30755上面设置
<pre class="lang-cs prettyprint prettyprinted" style="margin-top: 0px; margin-bottom: 1em; padding: 5px; border: 0px; font-size: 13px; overflow: auto; width: auto; max-height: 600px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; color: rgb(57, 51, 24); word-wrap: normal; background-color: rgb(238, 238, 238);"><code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"><span class="str" style="margin: 0px; padding: 0px; border: 0px; color: rgb(128, 0, 0);">Access-Control-Allow-Origin: *</span></code>
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods" : "GET,POST,PUT,DELETE,OPTIONS
设置方式有多种
web.config或者代码设置也行。
0 0
- aurelia 跨域问题
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- Aurelia快速搭建
- 前端框架Aurelia
- 前端框架Aurelia
- 前端框架Aurelia
- Aurelia中的HTML行为介绍
- Porting an Angular 2.0 App to Aurelia
- 前端框架Aurelia —— 路由Router
- 深入浅出JavaScript(2)—ECMAScript
- Java内部类的使用小结
- STL 源码学习笔记——vector
- fstat、stat和lstat 区别
- mysql数据库中修改用户密码
- aurelia 跨域问题
- ICMP (网际控制报文协议)
- leetcode 017 —— Letter Combinations of a Phone Number
- BOOST开发指南
- Kind Editor 编辑器 指定初始化模块
- POJ 2209 The King(水~)
- 王家林亲授《DT大数据梦工厂》大数据实战视频“Scala深入浅出实战经典” 第46讲视频、音频和PPT下载!
- JM配置文件Encoder.cfg中比较重要的几项
- 模仿大众点评过滤框