在入口文件index.php中添加
header('Access-Control-Allow-Headers:x-requested-with,content-type'); header('Access-Control-Allow-Origin:http://localhost:8888');