We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.0.0
在小程序内有很多业务接口需要在登陆后在获取接口信息,那么是否可能在请求发起前先校验本地 token 是否存在,不存在直接挂起这个请求发情登录请求,等登录完成后,再将这个请求继续下去呢
示例:
http.interceptors.request.use(async config => { let token = wx.getStorageSync('token') if (!token) { // 没有登录的的情况下重新发起登录 await store.dispatch('login') } token = wx.getStorageSync('token') config.headers.cookie = `token=${token}` return config })
另外库非常好用,谢谢作者!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当前版本
环境
需求描述
在小程序内有很多业务接口需要在登陆后在获取接口信息,那么是否可能在请求发起前先校验本地 token 是否存在,不存在直接挂起这个请求发情登录请求,等登录完成后,再将这个请求继续下去呢
示例:
另外库非常好用,谢谢作者!
The text was updated successfully, but these errors were encountered: