Giter Club home page Giter Club logo

Comments (11)

JacksonTian avatar JacksonTian commented on June 23, 2024

不是写了 去调用getAccessToken,然后重试么。

from wechat-api.

silentMood avatar silentMood commented on June 23, 2024

代码里面看,在重试之前,如果代码中的AccessToken().isValid()验证通过,就直接redo。。。 但是我在线上偶尔会发现莫名奇妙在有效期内就过期了,然后就一直跪,在这只算是个hack。。。

from wechat-api.

silentMood avatar silentMood commented on June 23, 2024

完整修改是这样,看是否有问题,或者帮助意义
2015-10-27 3 33 01

from wechat-api.

JacksonTian avatar JacksonTian commented on June 23, 2024

和wechat-api写的区别是什么?

from wechat-api.

silentMood avatar silentMood commented on June 23, 2024

区别是一旦出现上述那种在 token有效期内的 40001,就重新获取accessToken然后redo,现有代码在出现这种情况就会一直跪。
重现方式:程序运行期间,手动修改一个有效期内的无效的token,然后就看到了

from wechat-api.

JacksonTian avatar JacksonTian commented on June 23, 2024

我懂你意思了。我们做的是临界点过期的40001,调用preRequest就会进入getAccessToken的流程,因为下次判断isValid的时候会失败。你这种是意外token失效的情况下 也生效对吧。 但是目前不推荐这样改。因为当你碰到一个集群都去调用刷新accessToken的时候,就跪了。

from wechat-api.

JacksonTian avatar JacksonTian commented on June 23, 2024

在什么情况下 token会意外失效?建议token统一管理,不要另外再留更新token的入口。

from wechat-api.

silentMood avatar silentMood commented on June 23, 2024

犯懒没仔细查原因,,, 还是仔细查下原因看看。 多谢回复哈

from wechat-api.

JacksonTian avatar JacksonTian commented on June 23, 2024

那这个issue暂时先关闭了。

from wechat-api.

XGHeaven avatar XGHeaven commented on June 23, 2024

@silentMood 我现在的做法就是遇到40001错误的时候,手动创建一个队列,让后面的请求都进入队列中,当新的Accesstoken请求完成之后,依次从队列中取出来,然后继续执行。

from wechat-api.

liangwenzhong avatar liangwenzhong commented on June 23, 2024

@JacksonTian 我也遇到这个问题,微信的accesstoken提早过期了。但是wechat-api单纯判断了有效期,导致一段时间程序会报错。等有效期过了,才能恢复正常。求指点,如何处理?

accesstoken,程序没有去修改,是否微信的机制修改了?

from wechat-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.