@CrossOrigin未解決跨域問題
jquery-2.0.2.min.js:6 Access to XMLHttpRequest at 'file:///user/getopt' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
2023-01-10
解決方法
withCredentials 屬性
CORS 請求默認不發送 Cookie 和 HTTP 認證信息。如果要把 Cookie 發到服務器,一方面要服務器同意,指定?
Access-Control-Allow-Credentials
?字段。出現這個報錯信息很可能是你在前端設置了?
withCredentials = true;
?你可以去掉這個設置。2022-07-09
好像是版本太新了, 要舊版本. 具體原因我也沒整明白
2022-03-16
這樣也沒解決
這個也沒打錯