我一直在尝试访问从 lyrebird API 获得的重定向中的变量,例如: http ://website.com/auth/lyrebird#access_token=value1&token_type=bearer&state=value2 我无法通过 GET 或访问此 access_token邮政。任何帮助表示赞赏。
编辑:很抱歉,在发布问题之前我必须进行更深入的搜索。我发现 url 中的那些 # 是用于锚标记的,它从未真正发送到服务器。如果将来有人遇到同样的问题,这就是我所做的:
var hash = window.location.hash.substring(1); //将哈希放入变量中,并删除#字符 window.location.replace('your django url?hash='+hash);我用这个脚本发送了回复。