解決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要設(shè)置
/
,否則會不生效; - 最后,設(shè)置好之后記得重啟前端先項目,讓代理配置生效。
其他原因分析參考:
https://blog.csdn.net/m0_46098807/article/details/107998799文章來源:http://www.zghlxwxcb.cn/news/detail-779394.html
Mixed error問題記錄:文章來源地址http://www.zghlxwxcb.cn/news/detail-779394.html
- 博主自留地:是因為本地Fetch請求代理多了一層/api/導(dǎo)致的;
也就是proxyRewirete跨域代理設(shè)置的/api/與Fetch設(shè)置的/api/重復(fù)了,導(dǎo)致了兩次
到了這里,關(guān)于解決Proxy error: Could not proxy request /api/index/webconfig from localhost:8080 to http://www.xx.com的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!