繁体   English   中英

使用useHash的Angular 7应用程序中的Instagram API重定向URL:在Apache服务器上为true

[英]Instagram API redirect URL in Angular 7 application using useHash: true on Apache Server

如何在Apache服务器上设置Angular应用程序?

目前,我在Instagram身份验证方面遇到问题。

在Angular应用程序中,如果我们想直接访问Apache服务器上的任何角度页面,请说http://example.com/some-route ,那么我们必须在app.routing中启用“ useHash:true”。 然后,它将以http://example.com/#/some-route将我重定向到该路由。

但是在Instagram身份验证期间,IG不会在重定向URL中使用# 现在,当我将IG重定向URL作为http://example.com/#/传递时,默认情况下,它将在应用程序之前将身份验证参数返回为http://example.com/?code=<some-code>能够捕获URL中的参数,Angular将其转换为: http://example.com/#/ : http://example.com/#/

任何帮助表示赞赏。

这对我有帮助:将产品构建部署到Apache 2

我使用以下规则创建了.htaccess文件:

<IfModule mod_rewrite.c>
  Options Indexes FollowSymLinks
  RewriteEngine On
  RewriteBase / 
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>

而且,现在我可以不使用#重定向到任何组件。 我在应用路由器中设置了useHash: false 现在,我可以在Instagram身份验证后捕获URL参数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM