西伯利亚牧马人
西伯利亚牧马人
  • 发布:2016-05-31 20:49
  • 更新:2016-06-01 12:30
  • 阅读:4740

ajax访问请求出错,请赐教

分类:MUI

错误代码提示如下:
[Web浏览器] "XMLHttpRequest cannot load http://120.55.144.237:8080/api/manager-order/search. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access." /haifu/main.html (0)
[Web浏览器] "Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://120.55.144.237:8080/api/manager-order/search'." /haifu/js/mui.min.js (7)
[Web浏览器] "XMLHttpRequest cannot load http://120.55.144.237:8080/api/manager-order/search. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8020' is therefore not allowed access." /haifu/main.html (0)
[Web浏览器] "Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://120.55.144.237:8080/api/manager-order/search'." /haifu/js/mui.min.js (7)

2016-05-31 20:49 负责人:无 分享
已邀请:
BoredApe

BoredApe - 有问题就会有答案。

跨域无法访问,如果是app项目可通过给mui.ajax 添加crossDomain参数解决处理详细可参考mui ajax文档

  • 西伯利亚牧马人 (作者)

    我访问的地址和端口号都是一样的,在后台测试修改 public Response orderSearch(HttpSession httpSession,@RequestBody MerchantPayOrderCommonVO vo) {

    修改为public Response orderSearch(HttpSession httpSession, MerchantPayOrderCommonVO vo) {

    即可访问成功,但是接口不允许去掉这个东西 ,其他地方要用。仍然没有解决掉

    2016-06-02 14:28

西伯利亚牧马人

西伯利亚牧马人 (作者)

坐等大神回答。

赵梦欢

赵梦欢 - 专注前端,乐于分享!

https://segmentfault.com/a/1190000005589813

坛子

坛子

明显跨域问题,可以使用mui.ajax或者plus.net.XMLHttpRequest

  • 西伯利亚牧马人 (作者)

    这个不是跨域问题,在访问后台接口时发生的错误,错误已经找到。但是没有解决。

    2016-06-02 00:10

  • nijiwa

    回复 西伯利亚牧马人: 错务解决了吗?能告诉我吗。遇到了同样的问题。

    2019-07-25 15:41

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