Javascript AngularJS应用程序重定向后Instagram#access_令牌丢失
我正在用Instagram的API编写一个应用程序 由于它是一个纯JS应用程序(angular JS),因此我正在使用的就是这个应用程序,然而,在Instagram重定向到我的Javascript AngularJS应用程序重定向后Instagram#access_令牌丢失,javascript,angularjs,instagram-api,Javascript,Angularjs,Instagram Api,我正在用Instagram的API编写一个应用程序 由于它是一个纯JS应用程序(angular JS),因此我正在使用的就是这个应用程序,然而,在Instagram重定向到我的redirect_uri后,url中的access_令牌(以#符号开头)会丢失,因为页面会重新加载 而不是像这样获取url: localhost:9000/#/#访问令牌=[token] 在url中短暂地看到令牌后,我得到的确切信息如下: localhost:9000/#/ 资料 获取访问令牌的url如下:https://
redirect_uri
后,url中的access_令牌(以#符号开头)会丢失,因为页面会重新加载
而不是像这样获取url:
localhost:9000/#/#访问令牌=[token]
在url中短暂地看到令牌后,我得到的确切信息如下:
localhost:9000/#/
资料
获取访问令牌的url如下:https://api.instagram.com/oauth/authorize/?client_id=[我的客户端\u id]&重定向\u uri=http://localhost:9000/&response_type=token
在应用程序的.config中,在路由定义中,root的定义如下:
.when('/',{
templateUrl: 'views/login.html',
controller: 'LoginCtrl',
controllerAs: 'login'
})
为什么会发生这种情况?我如何解决这个问题,以便获得用户的访问令牌
非常感谢您提供的帮助。您可以做的是,当instagram点击您的路线时,您可以将返回的令牌存储在$localStorage中。