header(‘Access-Control-Allow-Origin: *’);
header(“Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type,X-Token, Accept”);
header(‘Access-Control-Allow-Methods: POST,GET’);
if(request()->isOptions()){
exit();
}
博客列表 >thinkphp跨域问题解决
header(‘Access-Control-Allow-Origin: *’);
header(“Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type,X-Token, Accept”);
header(‘Access-Control-Allow-Methods: POST,GET’);
if(request()->isOptions()){
exit();
}