Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS应用程序重定向后Instagram#access_令牌丢失_Javascript_Angularjs_Instagram Api - Fatal编程技术网

Javascript AngularJS应用程序重定向后Instagram#access_令牌丢失

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://

我正在用Instagram的API编写一个应用程序

由于它是一个纯JS应用程序(angular JS),因此我正在使用的就是这个应用程序,然而,在Instagram重定向到我的
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中。