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

Fetch网络请求中考虑增加基于jwt的api认证以及无感知自动重新刷新token的功能 #92

Open
lisenz opened this issue Oct 19, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@lisenz
Copy link

lisenz commented Oct 19, 2020

Description

目前我们小程序项目对于业务API的请求是基于JWT认证的流程,在请求业务API的时候,会先到授权认证中心获取token,之后携带token去请求API,在这个过程中,当token过期时,需要无感知自动刷新获取一个新的token,并重新去请求之前因token过期导致请求失败的业务API,即需要一个合理的重试机制。

希望可以在Fetch这里增加以上需求功能。

@Genuifx
Copy link
Contributor

Genuifx commented Oct 19, 2020

增加一个拦截器机制怎么样?

@lisenz
Copy link
Author

lisenz commented Oct 27, 2020

@Genuifx

增加一个拦截器机制怎么样?

感觉应该可行,大佬可以试试看

@Genuifx Genuifx added the enhancement New feature or request label Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants