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过期和expireTime时间不一定一致,收到40001后,需要重新获取token #127

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/api_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ API.prototype.preRequest = function (method, args, retryed) {
if (err) {
return callback(err);
}
//重发时清除token,重新获取
if (retryed) {
token = null;
}

var accessToken;
// 有token并且token有效直接调用
if (token && (accessToken = AccessToken(token.accessToken, token.expireTime)).isValid()) {
Expand Down