$origin_whitelist = array(
'来源域名',
);
if (isset($_SERVER['HTTP_ORIGIN']) && in_array($_SERVER['HTTP_ORIGIN'], $origin_whitelist))
{
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Credentials: true');
}
PHP 跨域问题
最新推荐文章于 2024-07-03 19:43:50 发布