(self, code, scope=None)
return self.users.upsert_by_dict(data), data
服务号授权
        :rtype: (wechat_django.models.WeChatUser, dict)
        :raises: wechatpy.exceptions.WeChatOAuthException
服务号授权
        :rtype: (wechat_django.models.WeChatUser, dict)
        :raises: wechatpy.exceptions.WeChatOAuthException
服务号授权 : rtype : ( wechat_django . models . WeChatUser dict ) : raises : wechatpy . exceptions . WeChatOAuthException
def _auth_service(self, code, scope=None):
        """服务号授权
        :rtype: (wechat_django.models.WeChatUser, dict)
        :raises: wechatpy.exceptions.WeChatOAuthException
        """
        from ..oauth import WeChatSNSScope
        if isinstance(scope, six.text_type):
            scope = (scope,)
        data = self.oauth.fetch_access_token(code)
        if scope and WeChatSNSScope.USERINFO in scope:
            # TODO: 优化授权流程 记录accesstoken及refreshtoken 延迟取userinfo
            user_info = self.oauth.get_user_info()
            data.update(user_info)
        return self.users.upsert_by_dict(data), data
def _auth_service ( self , code , scope = None ) : from . . oauth import WeChatSNSScope if isinstance ( scope , six . text_type ) : scope = ( scope , ) data = self . oauth . fetch_access_token ( code ) if scope and WeChatSNSScope . USERINFO in scope : # TODO: 优化授权流程 记录accesstoken及refreshtoken 延迟取userinfo user_info = self . oauth . get_user_info ( ) data . update ( user_info ) return self . users . upsert_by_dict ( data ) , data