update
This commit is contained in:
4
utils.py
4
utils.py
@@ -25,13 +25,15 @@ from pydantic import BaseModel
|
||||
|
||||
|
||||
# 保存好友信息
|
||||
def saveWxidInfo(account_wxid, wxid,openId=None):
|
||||
def saveWxidInfo(account_wxid, wxid,openId=None,h5openid=None):
|
||||
allFriend = WXBotService.get_address_list(account_wxid)
|
||||
for friendItem in allFriend['data']["contactList"]:
|
||||
if friendItem['wxid'] == wxid:
|
||||
# 存储小程序openid
|
||||
if openId:
|
||||
friendItem['openId'] = openId
|
||||
if h5openid:
|
||||
friendItem['h5openid'] = openId
|
||||
friendItemObj = models.User(**friendItem)
|
||||
db_user = crud.get_user_by_wxid(db=SessionLocal(), wxid=wxid)
|
||||
if db_user:
|
||||
|
||||
Reference in New Issue
Block a user