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
我这边的版本 (可能和github上的有差异) , 该文件第 161 行 有时候会报错. 错误的原因是, data 为空
API.prototype.getAccessToken = function (callback) { var that = this; var url = this.prefix + 'token?grant_type=client_credential&appid=' + this.appid + '&secret=' + this.appsecret; this.request(url, {dataType: 'json'}, wrapper(function (err, data) { if (err) { return callback(err); } // 过期时间,因网络延迟等,将实际过期时间提前10秒,以防止临界点 // *************************** 这里就是 161 行 *************************** // var expireTime = (new Date().getTime()) + (data.expires_in - 10) * 1000; // ************************************************************************** // var token = AccessToken(data.access_token, expireTime); that.saveToken(token, function (err) { if (err) { return callback(err); } callback(err, token); }); })); return this; };
建议此处 data如果为空 当做错误处理. 或者是在外层的某个地方生成 err .
The text was updated successfully, but these errors were encountered:
No branches or pull requests
我这边的版本 (可能和github上的有差异) , 该文件第 161 行 有时候会报错.
错误的原因是, data 为空
建议此处 data如果为空 当做错误处理.
或者是在外层的某个地方生成 err .
The text was updated successfully, but these errors were encountered: