通過微信提供的上傳下載多媒體文件文檔 的下載文件功能時(shí)候。從中控緩存 (單例模式把 access_token 存在內(nèi)存中每次用的時(shí)候去計(jì)算是否到期去刷新)中取 access_token 和從手機(jī)的上傳圖片后的得到 mediaid,直接字符串拼接形成這樣的的鏈接
http://file.api.weixin.qq.com...
這個(gè)鏈接直接通過瀏覽器去下載時(shí)候報(bào) 40001
可是我多刷新幾次后又有圖片出來了。。。
如果說 access_token 過期了應(yīng)該不管怎么刷新的也不行的啊,, 還是access_token刷新機(jī)制就是這樣的。
走同樣的路,發(fā)現(xiàn)不同的人生
I have encountered such a problem, I don’t know if it is the same as yours.
Because ACCESS_TOKEN is refreshed in other places, such as the production environment, the ACCESS_TOKEN in the development environment is invalid.
Vice versa.