前后端完全开发问题

php  解决跨域问题

header('Access-Control-Allow-Origin:http://www.***.com');

header("Access-Control-Allow-Credentials:true");

header("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");



$.ajax({

  url: a_cross_domain_url,

  // 将XHR对象的withCredentials设为true

  xhrFields: {

      withCredentials: true

  }

});

你可能感兴趣的:(前后端完全开发问题)