public function behaviors()
{
$behaviors = [
'corsFilter' => [
'class' => Cors::className(),
'cors' => [
'Origin' => [],//跨域的域名数组
'Access-Control-Request-Method' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'],
'Access-Control-Request-Headers' => ['*'],
'Access-Control-Allow-Origin' => ['*'],
'Access-Control-Allow-Credentials' => true,
'Access-Control-Max-Age' => 86400,
'Access-Control-Expose-Headers' => [],
],
],
];
return $behaviors;
}
$.ajax({
type: "POST",
data: {},
url: wxCheckUrl,
async: false,
crossDomain:true,
success: function(msg) {}
});
Comment here is closed