Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何才能在请求中刷新token? #146

Open
ramseyfeng opened this issue Nov 5, 2022 · 2 comments
Open

如何才能在请求中刷新token? #146

ramseyfeng opened this issue Nov 5, 2022 · 2 comments

Comments

@ramseyfeng
Copy link

你好,这个库用了目前唯一痛点就是没个好的方法刷新token,因为刷新token是个异步方法,即使在headers中去刷新,因为headers并不支持异步,headers方法是个同步方法,造成偶尔刷新token还是不成功,请问headers是否能考虑支持Promise返回?

@llblax
Copy link

llblax commented Nov 8, 2022

大神,headers中去刷新token怎么做到的?

@ramseyfeng
Copy link
Author

@llblax 说了也没好办法,headers并不支持异步的等待,这里只能更换token
至于刷新,可以在页面搞个定时器,希望有更好的办法

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants