7***@qq.com
7***@qq.com
  • 发布:2020-12-15 21:19
  • 更新:2020-12-15 21:19
  • 阅读:410

关于ajax 跨域问题

分类:MUI

本地服务器iis运行环境
后台框架tp5
两台电脑,一台作为服务器,一台作为前端访问
ajax请求一直报跨域问题。
iis 已经设置允许跨域,jq方法的ajax提交没有问题,就mui.ajax提交一直报错。

困扰我一天的,哪位大神遇到过这个问题呀?

mui.ajax('http://192.168.2.100:8888/api/user/adduser', {
data: {
mobile: phone
},
dataType: 'json',
type: 'POST',
timeout: 10000,
success: function(data) {
alert(data);
},
error: function(xhr,type,errorThrown) {
console.log(type);
}
});
XMLHttpRequest cannot load http://192.168.2.100:8888/api/user/adduser. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.1.13:8020' is therefore not allowed access.

2020-12-15 21:19 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复