项目中的APP要跟H5对接时遇到了跨域问题 以下是解决方法
在返回json格式前输入以下三行。
header('Access-Control-Allow-Origin:*');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header('Access-Control-Allow-Methods: GET, POST, PUT');
项目中的APP要跟H5对接时遇到了跨域问题 以下是解决方法
在返回json格式前输入以下三行。
header('Access-Control-Allow-Origin:*');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header('Access-Control-Allow-Methods: GET, POST, PUT');