def inner(*args, **kwargs): if src.user_info['name']: res = func(*args, **kwargs) return res else: print("请先登录!") src.login()
def inner(*args, **kwargs): if src.login_user: res = func(*args, **kwargs) return res else: print('您还没有登录,请登录后操作!') src.login()
def inner(*args, **kwargs): if src.login_user: res = func(*args, **kwargs) return res else: print('用户未登录') src.login()
def inner(*args, **kwargs): if src.login_user: res = func(*args, **kwargs) return res else: print('未出示证明,无法享受美好的功能服务') src.login()
def inner(*args, **kwargs): if src.user_info["user"]: res = func(*args, **kwargs) return res else: print("请登陆!") src.login()
def inner(*args, **kwargs): if src.user_key.get('token'): res = func(*args, **kwargs) return res else: print("请先登录!") src.login()
def wrapper(*args,**kwargs): if src.login_stat: res = func(*args,**kwargs) return res else: print('登录状态异常,请重新登录') src.login()
def wrapper(*args, **kwargs): if not src.user_auth.get('username'): src.login() res = func(*args, **kwargs) return res res = func(*args, **kwargs) return res
def inner(*args, **kwargs): if src.user_info.get('user'): res = func(*args, **kwargs) return res else: print('请先登录!') src.login()
def inner(*args, **kwargs): if src.user_inf.get('user'): res = func(*args, **kwargs) return res else: print('还未登录,请登录') src.login()
def inner(*args, **kwargs): if src.user_info.get('username'): res = func(*args, **kwargs) return res else: print('未登录,请去登录') src.login()
def wrapper(*args, **kwargs): if src.login_user: res = func(*args, **kwargs) return res else: print("请先登录账户") src.login()
def wrapper(*args, **kwargs): if src.user_info['user']: res = func(*args, **kwargs) return res else: print('请先登录') src.login()
def inner(*args, **kwargs): # 调用被装饰函数前需要做的操作 if src.user_info['name']: res = func(*args, **kwargs) # 调用被装饰函数后需要做的操作 return res else: src.login()
def inner(*args, **kwargs): # 原函数执行之前的添加功能 if src.user_info['name']: res = func(*args, **kwargs) # 原函数执行之后要添加的功能 return res else: # 否则去重新登陆 src.login()
def auth(*args, **kwargs): if not src.user_data['name']: src.login() # 登录后直接跳转至用户选择的功能 if src.user_data['name']: return func(*args, **kwargs) # 用于结束函数(用户输入三次之后) return return func(*args, **kwargs)
def wrapper(*args, **kwargs): if not src.login_user: print('未登录,请先登录!') src.login() res = func(*args, **kwargs) return res else: res = func(*args, **kwargs) return res
def wrapper(*args, **kwargs): if src.login_user: # 认证了才能进行的操作 res = func(*args, **kwargs) return res else: # 没有登录,先进行登录 print('用户没有登录,无法使用功能') src.login()
def inner(*args, **kwargs): if src.user_info[0]: res = func(*args, **kwargs) return res else: print('未登录,请先登录') src.login() res = func(*args, **kwargs) return res
def inner(*args, **kwargs): # 判断用户存在, 则执行被装饰函数 if src.user_info['user']: res = func(*args, **kwargs) return res # 否则,执行登陆功能 else: print('请先登陆') src.login()
def inner(*args, **kwargs): if src.user_info.get('user'): # nick_sb # res = check_balance(*args, **kwargs) # return res res = func(*args, **kwargs) return res else: print('未登录,请去登录!') src.login()
def wrapper(*args,**kwargs): if not src.user_auth.get('username'): res=src.login() func(*args, **kwargs) return res else: func(*args,**kwargs)
def inner(*args,**kwargs): if src.is_load: res = func(*args,**kwargs) return res else: print("请先登录") return src.login()
def inner(): if src.login_dic["status"]: ret = f() return ret else: ret = src.login(f) return ret
def inner(*args, **kwargs): if src.status_dic['status']: ret = func(*args, **kwargs) return ret else: print('\033[1;31;0m 请先进行登录 \033[0m') if src.login(): ret = func(*args, **kwargs) return ret
def inner(*args, **kwargs): if src.status_dic["status"]: ret = func(*args, **kwargs) return ret else: print("\033[1;31;40m 请先进行登录 \033[0m") if src.login(): ret = func(*args, **kwargs) return ret
def inner(*args,**kwargs): '''访问函数之前的操作,功能''' if src.status_dict['status']: ret = f(*args,**kwargs) '''访问函数之后的操作,功能''' return ret else: if src.login(): ret = f(*args, **kwargs) return ret
def inner(*args, **kwargs): if src.status_dic['status']: ret = f(*args, **kwargs) return ret else: print('要使用此功能请先登录!') time.sleep(1) if src.login(): ret = f(*args, **kwargs) return ret else: print("登陆失败!")
def wrapper(*args, **kwargs): if not src.user_data["name"]: src.login() else: return func(*args, **kwargs)
def inner(*args,**kwargs): if src.user_auth['user'] == None: src.login() else: res = func(*args,**kwargs) return res