【问题标题】:How to submit Form method = post to different server in Angular2如何提交表单方法=发布到Angular2中的不同服务器
【发布时间】:2017-06-19 14:32:20
【问题描述】:

我的表单帖子

<html>
<head>
    <title>Submit this form</title>
</head>
<body>
    <form method="post" action="http://localhost:4200/callback">
        <input type="hidden" name="access_token" value="eyJ0" />
<input type="hidden" name="token_type" value="Bearer" />
<input type="hidden" name="expires_in" value="3600" />
<input type="hidden" name="scope" value="read write" />
<input type="hidden" name="state" value="Ra7JV" />
    </form>
</body>
</html>

http://localhost:4200/callback 被调用时,导航到回调组件。但在这里它无法导航到显示无法 POST /callback 的回调组件。

如何在我的 angular2 CallbackComponent 中捕获帖子表单。

【问题讨论】:

    标签: angular authentication angular2-services angular2-jwt


    【解决方案1】:

    这是给像我这样的新手的:

    为了实现这一点,我编写了服务器端代码 -> node.js(express) where app.post('/callback') 尽我所能并重定向到我的客户端。

    【讨论】:

      猜你喜欢
      • 2016-04-22
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      • 1970-01-01
      • 2019-01-01
      • 1970-01-01
      • 2019-02-26
      • 2019-04-22
      相关资源
      最近更新 更多