AzureCN
Results
1
comments of
AzureCN
对与在一个服务中管理多个程序,我采用的如下代码(简化后),这样每次通过ent_id查询对应企业的信息来操作对应企业的公众号且不会重复,感觉加入小程序判断即可达到要求 ```Python _wechat_container = dict() def wechat_container(ent_id): client = _wechat_container.get(ent_id) if not client: wechat_info = WechatInfo.query.filter_by(ent_id=ent_id).first() if wechat_info: client = WeChatClient(wechat_info.app_id, wechat_info.app_secret) _wechat_container[ent_id] = client else: raise ValueError('没有对应数据') return client...