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

【小程序】建议提供获取access_token成功后相关回调 #3000

Closed
FreeOfYou opened this issue Apr 30, 2023 · 4 comments · Fixed by #3005
Closed

【小程序】建议提供获取access_token成功后相关回调 #3000

FreeOfYou opened this issue Apr 30, 2023 · 4 comments · Fixed by #3005

Comments

@FreeOfYou
Copy link

每次更新小程序access_token时,想把access_token持久化到数据库,每当项目启动的时候,先查看数据库是否过期,如果没过期,则进行redis的access_token初始化。这样能做到access_token高可用

@FreeOfYou
Copy link
Author

FreeOfYou commented Apr 30, 2023

目前我的解决方案是重写了 cn.axzo.diplomat.server.infrastructure.wx.WxMaCustomerRedisBetterConfigImpl#updateAccessToken 方法,提供了一个更新access_token前的回调函数

@binarywang
Copy link
Owner

欢迎提供PR代码,另外你这个包名也不是本SDK提供的啊

@FreeOfYou
Copy link
Author

目前我的解决方案是重写了 cn.axzo.diplomat.server.infrastructure.wx.WxMaCustomerRedisBetterConfigImpl#updateAccessToken 方法,提供了一个更新access_token前的回调函数

这个,上面写错了
cn.binarywang.wx.miniapp.config.impl.WxMaRedisBetterConfigImpl#updateAccessToken

@binarywang
Copy link
Owner

写错了,无所谓,你可以把你重写的方法代码贡献出来,提交PR即可

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

Successfully merging a pull request may close this issue.

2 participants