英文:
login to external url and come back to angular app
问题
我的问题是我有一个外部网址,我需要调用这个外部网址(由另一个客户端创建),然后需要返回到主页。我在我的ts文件中写了以下代码:
<button class="altro" title="(click)="effettuaLoginExternal($event)">登录</button>
在我的ts文件中,我写了:
effettuaLoginExternal(event) {
window.location.href="/external/login";
}
当我执行 window.location.href="/external/login";
时,会打开这个外部网址,我可以输入用户名和密码,但是在点击“确定”按钮后无法返回到Angular应用程序。我没有这个外部网址的代码。有人可以帮我吗?
英文:
My problem is that I have and external url, I need to call this external url (created by another client) and after I need to come back into home page. I do
<button class="altro" title=" (click)="effettuaLoginExternal($event)">login</button>
in my ts I do:
effettuaLoginExternal(event) {
window.location.href="/external/login";
}
when I Do window.location.href="/external/login";
open this external url and I can insert the username and password but I cannot back to angular application after I click on button "ok" . I don't have the code of this external url. Anyone can help me?
答案1
得分: 2
如果用户需要离开您的网站并与第三方网站互动,那么他们唯一能够返回您的网站的方式是第三方网站将他们发送回来。
如果没有第三方的合作,最接近的方式是在新窗口或框架中打开他们的网站。您将无法从第三方网站收集任何数据(例如,您无法确认用户成功登录到第三方网站),您将依赖用户在准备好时点击返回到您网站的窗口。
英文:
If the user needs to leave your site and interact with a third-party site, then the only way they are going to return to your site is if the third party-side sends them back.
The closest you could come without the cooperation of the third-party would be to open their site in a new window or a frame. You would not be able to collect any data from the third-party site (e.g. you could not confirm the user logged into the third-party site successfully) and you would depend on the user to click back on the window for your site when they were ready.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论