PHP解决跨域

// 允许域名跨域访问 *可替换为域名
header('Access-Control-Allow-Origin: *');
// 响应类型
header('Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELTE,OPTIONS');
// 带 cookie 的跨域访问
header('Access-Control-Allow-Credentials: true');
// 响应头设置
header('Access-Control-Allow-Headers: Accept,Accept-Encoding,Content-Type,Content-Length,User-Agent,Referer,X-Requested-With,X-CSRF-Token,Origin');