$origin_weburl = isset($_SERVER['HTTP_ORIGIN'])? $_SERVER['HTTP_ORIGIN'] : '';
if(in_array($origin_weburl, $allow_origin)){
//origin_weburl 当前域名 allow_origin 允许域名(为数组形式)
header('Access-Control-Allow-Origin:'.$origin_weburl);
}
header('Access-Control-Allow-Methods:GET, POST'); //表示只允许POST请求
header('Access-Control-Allow-Headers:x-requested-with, content-type');
uni-app H5 交互跨域问题
猜你喜欢
转载自blog.csdn.net/qq_32837111/article/details/106602755
今日推荐
周排行