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

配置多个公众号,SubscribeHandler怎么获取一个用户订阅的是哪一个公众号呢? #118

Open
hoony96 opened this issue Apr 23, 2021 · 6 comments

Comments

@hoony96
Copy link

hoony96 commented Apr 23, 2021

No description provided.

@binarywang
Copy link
Owner

service里对应有config吧

@hoony96
Copy link
Author

hoony96 commented Apr 26, 2021

从service中获取的一直是第一个公众号的配置
WxMpConfigStorage wxMpConfigStorage = weixinService.getWxMpConfigStorage();
wxMpConfigStorage.getAppId()

@domppo
Copy link

domppo commented Aug 3, 2021

image
WxMpConfigStorage wxMpConfigStorage = weixinService.getWxMpConfigStorage();
这个获取的是你配置的xxxxx在你项目的配置里边对应的config,不是你说的第一个,进去看weixinService.getWxMpConfigStorage()方法里边是维护的Map<String, WxMpConfigStorage> configStorageMap;
key是appid 就是xxxxx

@zaijian5188
Copy link

zaijian5188 commented Sep 14, 2021

WxMpConfigStorageHolder.get() 可以拿到appid。
但是不会用WxMpConfigStorageHolder.remove()。不知道会不会存在高并发串值的问题?

@dai794251336
Copy link

多个微信号使用 weixinService.getWxMpConfigStorage();这个方法,获取出来的是null,请问有遇到过吗

@w2cl
Copy link

w2cl commented Nov 15, 2023

image WxMpConfigStorage wxMpConfigStorage = weixinService.getWxMpConfigStorage(); 这个获取的是你配置的xxxxx在你项目的配置里边对应的config,不是你说的第一个,进去看weixinService.getWxMpConfigStorage()方法里边是维护的Map<String, WxMpConfigStorage> configStorageMap; key是appid 就是xxxxx

return this.configStorageMap.size() == 1 ? (WxMpConfigStorage)this.configStorageMap.values().iterator().next() : (WxMpConfigStorage)this.configStorageMap.get(WxMpConfigStorageHolder.get()); 这个不是获取的第一个吗?
image

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

No branches or pull requests

6 participants