(self, code, scope=None)
用code进行微信授权
        :rtype: (wechat_django.models.WeChatUser, dict)
        :raises: wechatpy.exceptions.WeChatClientException
        :raises: wechatpy.exceptions.WeChatOAuthException
用code进行微信授权
        :rtype: (wechat_django.models.WeChatUser, dict)
        :raises: wechatpy.exceptions.WeChatClientException
        :raises: wechatpy.exceptions.WeChatOAuthException
用code进行微信授权 : rtype : ( wechat_django . models . WeChatUser dict ) : raises : wechatpy . exceptions . WeChatClientException : raises : wechatpy . exceptions . WeChatOAuthException
def auth(self, code, scope=None):
        """用code进行微信授权
        :rtype: (wechat_django.models.WeChatUser, dict)
        :raises: wechatpy.exceptions.WeChatClientException
        :raises: wechatpy.exceptions.WeChatOAuthException
        """
        if not self.abilities.api:
            raise WeChatAbilityError(WeChatAbilityError.API)

        if self.type & AppType.SERVICEAPP:
            if not self.abilities.oauth:
                raise WeChatAbilityError(WeChatAbilityError.OAUTH)
            return self._auth_service(code, scope)
        elif self.type & AppType.MINIPROGRAM:
            return self._auth_miniprogram(code)
        else:
            raise WeChatClientException(WeChatErrorCode.UNAUTHORIZED_API)
def auth ( self , code , scope = None ) : if not self . abilities . api : raise WeChatAbilityError ( WeChatAbilityError . API ) if self . type & AppType . SERVICEAPP : if not self . abilities . oauth : raise WeChatAbilityError ( WeChatAbilityError . OAUTH ) return self . _auth_service ( code , scope ) elif self . type & AppType . MINIPROGRAM : return self . _auth_miniprogram ( code ) else : raise WeChatClientException ( WeChatErrorCode . UNAUTHORIZED_API )