为了将 cookie 发送到服务器,我必须在选项参数中使用 { withCredentials: true },但是当我使用
this.http.get(this.accountUrl + 'ExternalLoginConfirmation', {
withCredentials: true })
我收到以下错误:
Response to preflight request doesn't pass access control check: The
value
of the 'Access-Control-Allow-Origin' header in the response must not be
the
wildcard '*' when the request's credentials mode is 'include'. Origin
'http://localhost:4202' is therefore not allowed access. The credentials
mode of requests initiated by the XMLHttpRequest is controlled by the
withCredentials attribute.
奇怪的事情:当我通过浏览器调用这个 url 时没有任何错误
你可以帮帮我吗?