我的代码和问题正是This。
但我收到了类似的错误
Access to XMLHttpRequest at 'http://localhost:8080/api/v1/basicauth' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
zone-evergreen.js:2828
GET http://localhost:8080/api/v1/basicauth net::ERR_FAILED
我在接受的答案中遵循了相同的说明,但仍然遇到相同的错误。
我在SpringSecurityConfig 课堂上添加了 doFilter 方法。不过,我得到了同样的错误。我在网络中收到以下错误。
http://localhost:8080/api/v1/basicauth如果我点击这个 URL 我得到 404 错误
从eclipse我正在运行调试模式,它没有显示任何调试点启用,可能是什么问题。
