def check_login(func):
@wraps(func)<EOL>def wrapper(*args, **kwargs):<EOL><INDENT>ret = func(*args, **kwargs)<EOL>if type(ret) == requests.Response:<EOL><INDENT>if ret.content[<NUM_LIT:0>]!=b'<STR_LIT:{>' and ret.content[<NUM_LIT:0>]!=b'<STR_LIT:[>':<EOL><INDENT>return ret<EOL><DEDENT>try:<EOL><INDENT>foo = json.loads(ret.content.decode('<STR_LIT:utf-8>'))<EOL>if '<STR_LIT>' in foo and foo['<STR_LIT>'] == -<NUM_LIT:6>:<EOL><INDENT>logging.debug(<EOL>'<STR_LIT>')<EOL>path = '<STR_LIT>'.format(args[<NUM_LIT:0>].username)<EOL>if os.path.exists(path):<EOL><INDENT>os.remove(path)<EOL><DEDENT>args[<NUM_LIT:0>]._initiate()<EOL><DEDENT><DEDENT>except:<EOL><INDENT>raise LoginFailed('<STR_LIT>')<EOL><DEDENT><DEDENT>return ret<EOL><DEDENT>return wrapper<EOL>
检查用户登录状态
    :param func: 需要被检查的函数