我正在尝试在Vue项目中实现Oauth(使用Github),当我的回调URL从Github被调用时,它会在URL的哈希之前附加查询字符串?code=something
。
例如,如果我在浏览器中加载https://myapp.com
并单击我的登录链接<a href="https://github.com/login/oauth/authorize?scope=user:email&client_id=1234j1234jk&redirect_uri=https://myapp.com/#/something">Login</a>
,将重定向到https://myapp.com/?code=asdfasdf#/something
,这意味着this.$route.query
为空。
作为Vue和Oauth的新手,我该如何解决这个问题,以便当我的回调被调用时,它会转到https://myapp.com/#/something?code=asdfadsf
,以便this.$route.query
包含代码?