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

invalid credential, access_token is invalid or not latest hint #46

Open
zhaoyanxiang opened this issue Mar 12, 2020 · 2 comments
Open

Comments

@zhaoyanxiang
Copy link

现在有极小概率出现这个提示,可能是其他地方调用了access_token,导致我们自己的过期了,我目前就用了co-wechat-api和wechat-jssdk。
过期后我可能要等两个小时候业务才会恢复。能麻烦加入一个重新获取的机制吗,比如收到40001错误,就重新获取access_token,然后重新请求。

@JasonBoy
Copy link
Owner

手动掉一下wx.jssdk.getGlobalTokenAndTicket(true)获取新的token跟ticket试一下

getGlobalTokenAndTicket(force) {

@zhaoyanxiang
Copy link
Author

这样可以,我是领取卡包的时候出现这个错误的,这样就要每次都去刷新。
我是想能不能直接在底层给解决掉,类似这样
image
多谢啦

@JasonBoy JasonBoy added this to the v6.0 milestone Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants