优化工单模块,增加企微模块
This commit is contained in:
45
sg_wechat_enterprise/we_api/enterprise/client/api/service.py
Normal file
45
sg_wechat_enterprise/we_api/enterprise/client/api/service.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
from wechatpy.client.api.base import BaseWeChatAPI
|
||||
|
||||
|
||||
class WeChatService(BaseWeChatAPI):
|
||||
|
||||
def get_provider_token(self, provider_secret):
|
||||
"""
|
||||
获取应用提供商凭证
|
||||
|
||||
详情请参考
|
||||
http://qydev.weixin.qq.com/wiki/index.php?title=获取应用提供商凭证
|
||||
|
||||
:param provider_secret: 提供商的secret,在提供商管理页面可见
|
||||
:return: 返回的 JSON 数据包
|
||||
"""
|
||||
return self._post(
|
||||
'service/get_provider_token',
|
||||
data={
|
||||
'corpid': self._client.corp_id,
|
||||
'provider_secret': provider_secret,
|
||||
}
|
||||
)
|
||||
|
||||
def get_login_info(self, provider_access_token, auth_code):
|
||||
"""
|
||||
获取企业号管理员登录信息
|
||||
|
||||
详情请参考
|
||||
http://qydev.weixin.qq.com/wiki/index.php?title=获取企业号管理员登录信息
|
||||
|
||||
:param provider_access_token: 服务提供商的 accesstoken
|
||||
:param auth_code: OAuth 2.0 授权企业号管理员登录产生的 code
|
||||
:return: 返回的 JSON 数据包
|
||||
"""
|
||||
return self._post(
|
||||
'service/get_login_info',
|
||||
params={
|
||||
'provider_access_token': provider_access_token,
|
||||
},
|
||||
data={
|
||||
'auth_code': auth_code,
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user