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

Update oauth.py #745

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update oauth.py #745

wants to merge 1 commit into from

Conversation

bonashen
Copy link

@bonashen bonashen commented Sep 9, 2022

支持Oauth2用户授权,获取用户敏感信息

支持Oauth2用户授权,获取用户敏感信息
return self._post('auth/getuserdetail', data={
"user_ticket": user_ticket
})

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line at end of file

https://developer.work.weixin.qq.com/document/path/95833

:param user_ticket : 成员票据
:return :
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

获取访问用户敏感信息
详情请参考
https://developer.work.weixin.qq.com/document/path/95833

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

url_list.append(f'&agentid={agent_id}')

url_list.append(f'&scope={scope}')

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

if agent_id is None:
raise ValueError('when set snsapi_privateinfo to scope,must set agent_id')
url_list.append(f'&agentid={agent_id}')

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

]

if scope=='snsapi_privateinfo' :
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace around operator
whitespace before ':'

]

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

redirect_uri,
"&response_type=code&scope=snsapi_base",

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line contains whitespace

:return: 返回的 JSON 数据包
"""
redirect_uri = quote(redirect_uri, safe=b"")
redirect_uri = six.moves.urllib.parse.quote(redirect_uri, safe=b'')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'six'

@@ -8,43 +8,69 @@
class WeChatOAuth(BaseWeChatAPI):
OAUTH_BASE_URL = "https://open.weixin.qq.com/connect/oauth2/authorize"

def authorize_url(self, redirect_uri, state=None):
def authorize_url(self, redirect_uri, state=None,scope='snsapi_base',agent_id=None):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

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

Successfully merging this pull request may close these issues.

None yet

1 participant