1. 程式人生 > 其它 >成功解決:配置nginx反向代理不正確導致驗證碼失效的問題

成功解決:配置nginx反向代理不正確導致驗證碼失效的問題

技術標籤:httpjs

Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https 問題的解決

用node.js與vue實現前後端的一個專案,後端介面8080,前端請求介面在8081,發請求的時候報錯

Access to XMLHttpRequest at 'localhost:8080/login' from origin 'http://localhost:8081' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.

一開始我以為是簡單的跨域問題,後來上網發現這是這個問題

我檢查了一下我的程式碼

地址配置的問題

改為

就ok了。