-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
base: master
Are you sure you want to change the base?
Update oauth.py #745
Conversation
支持Oauth2用户授权,获取用户敏感信息
return self._post('auth/getuserdetail', data={ | ||
"user_ticket": user_ticket | ||
}) | ||
|
There was a problem hiding this comment.
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 : |
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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}') | ||
|
There was a problem hiding this comment.
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}') | ||
|
There was a problem hiding this comment.
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' : |
There was a problem hiding this comment.
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 ':'
] | ||
|
There was a problem hiding this comment.
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", | ||
|
There was a problem hiding this comment.
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'') |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing whitespace after ','
支持Oauth2用户授权,获取用户敏感信息