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

40014的access_token问题是否需要自动刷新token #197

Closed
binarywang opened this issue Apr 26, 2017 · 1 comment
Closed

40014的access_token问题是否需要自动刷新token #197

binarywang opened this issue Apr 26, 2017 · 1 comment

Comments

@binarywang
Copy link
Member

公众号和企业号模块均没有对40014的access_token问题({"errcode":40014,"errmsg":"invalid access_token"})做判断,进而重新刷新token,不知道各位遇到过没?

/*
       * 发生以下情况时尝试刷新access_token
       * 40001 获取access_token时AppSecret错误,或者access_token无效
       * 42001 access_token超时
       */
      if (error.getErrorCode() == 42001 || error.getErrorCode() == 40001) {
        // 强制设置wxMpConfigStorage它的access token过期了,这样在下一次请求里就会刷新access token
        this.getWxMpConfigStorage().expireAccessToken();
        if (this.getWxMpConfigStorage().autoRefreshToken()) {
          return this.execute(executor, uri, data);
        }
      }
@binarywang
Copy link
Member Author

先加上此判断

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

1 participant