class AccountSync(object):def __init__(self):# 微吼self.auth_type = 1 # 授权类型,1为验证帐号和密码(目前只通过帐号和密码验证)self.account = 'xxx' # auth_type为1时为必填项,用于登录e.vhall的帐号,是在“帐号设置”页面里查找到的“帐号”self.password = 'xxxx' # auth_type为1时为必填项,用于登录e.vhall的密码,用于登录的密码self.wh_find_url = "" # 获取微吼用户IDself.wh_add_url = "" # 创建微吼用户# 添加微吼用户def set_wh_user(self, user_list):if user_list:for user in user_list:username = user['name_']password = user['password_']body = {"third_user_id": username,"auth_type": self.auth_type,"account": self.account,"password": self.password}find_res = hx_request.post(url=self.wh_find_url, headers=self.headers, parameters=body)if find_res.data['code'] != '200': # 微吼没有该用户('微吼没有用户: %s' % user)body['pass'] = passwordresponse = hx_request.post(url=self.wh_add_url, headers=self.headers, parameters=body)if response.data['code'] != 200: # 增加微吼用户失败('增加微吼用户失败: %s, error_msg:%s' % (user, response.data['msg']))if response.data['code'] == 200: # 增加微吼用户成功logger.info('增加微吼用户成功: %s' % user)
其他接口微吼api文档:
.html
本文发布于:2024-02-01 06:56:37,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170674179934711.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |