我顺口溜
http://localhost:4200/login
php在
中运行http://127.0.0.1/trunk/server/
在这样的请求响应过程中出现错误:
Failed to load http://127.0.0.1/trunk/server/login: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
我像这样在httpd-vhosts.conf中创建了一个代理:
<VirtualHost *:80>
ServerName localhost
ProxyPreserveHost on
ProxyPass /wms http://localhost:4200
ProxyPassReverse /wms http://localhost:4200
</VirtualHost>
我也尝试过在角度使用proxy.config.json也不起作用。
任何解决方案。