微信授权跨域匹配用户openid信息,使用session、cookie方式
后端接口加入跨域设置
header("ACCESS-CONTROL-ALLOW-ORIGIN:允许的域名");
处理参数不带cookie值问题头部加入
header('Access-Control-Allow-Credentials:true');
允许方法设置
header('Access-Control-Allow-Methods:GET, POST, OPTIONS’);
前端ajax请求加入代码块
xhrFields:{
withCredentials:true
},