尝试代理请求 /oauth/token 时出现 Angular HPM 错误

时间:2021-03-17 08:49:38

标签: angular oauth proxy

我尝试运行我的 Angular,它编译成功。我可以在显示登录页面的浏览器中打开 UI。

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
: Compiled successfully.

但后来我收到此错误,无法继续访问我的应用程序。

[HPM] POST /oauth/token -> http://localhost:8090
[HPM] Error occurred while trying to proxy request /oauth/token from localhost:4200 to http://localhost:8090 (ECONNREFUSED) (https://nodejs.org/api/erro
rs.html#errors_common_system_errors)

这是我的 proxy.conf.json 文件:

{
  "/api/": {
    "target": "http://localhost:8090",
    "secure": false,
    "logLevel": "debug"
  },
  "/oauth/": {
    "target": "http://localhost:8090",
    "secure": false,
    "logLevel": "debug"
  }
}

不过,我使用的登录凭据在暂存时效果很好。有人遇到过同样的问题吗?我不知道如何解决这个问题。

0 个答案:

没有答案