<VirtualHost *:80> DocumentRoot /data/www/test ServerName test.com Header set Access-Control-Allow-Origin * Header set Access-Control-Allow-Credentials true Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept" <Directory /> Options FollowSymLinks ExecCGI Indexes AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
在 httpd-vhosts.conf 添加
Header set Access-Control-Allow-Origin *
Header set Access-Control-Allow-Credentials true
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
扫二维码,关注更多PHP资讯!