解决Proxy error: Could not proxy request /api/index/webconfig from localhost:8080 to http://www.xx.com
报错信息:
Proxy error: Could not proxy request /api/index/webconfig from localhost:8080 to http://www.xxxxxx.com
报错截图:
解决办法:
- 确保本地跨域配置正常,尤其是rewrite要设置
/
,否则会不生效; - 最后,设置好之后记得重启前端先项目,让代理配置生效。
其他原因分析参考:
https://blog.csdn.net/m0_46098807/article/details/107998799
Mixed error问题记录:
- 博主自留地:是因为本地Fetch请求代理多了一层/api/导致的;
也就是proxyRewirete跨域代理设置的/api/与Fetch设置的/api/重复了,导致了两次