无法从dist / index.html中以角度8登录,并且允许我使用proxy.conf.json文件

问题描述 投票:0回答:1

我正在使用角度8 dist文件夹中的index.html页面。无法通过dist / index.html页面登录。在下面获取登录API URL的错误。我花了两天,但没有运气。如果您对此有任何解决方案,请告诉我。

enter image description here

enter image description here

提前感谢。

javascript angular npm webpack webpack-dev-server
1个回答
0
投票

您是否在API上启用了CORS?如果您是从dist文件夹运行的,则可以在端口80上运行应用程序,但API在8080上,这可能会导致CORS问题。您需要在API上启用CORS。根据您的API语言实现,实现方式有所不同。

© www.soinside.com 2019 - 2024. All rights reserved.