1.针对跨域问题可以使用jsonp的方式解决

2.可以使用header头来定义

header('Access-Control-Allow-origin:*');
header('Access-Control-Allow-Credentials:true');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers:Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With');
header('Content-Type: text/html; charset=utf-8');

加上以后就可以了

但是这个缺陷是IE10以下的不支持!一般手机应用都可以用!

相关文章:

  • 2021-05-29
  • 2021-10-28
  • 2022-12-23
  • 2021-05-02
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-17
  • 2021-04-23
  • 2021-11-04
  • 2022-12-23
  • 2022-01-03
  • 2021-10-07
相关资源
相似解决方案