import timedef auth(func): def wrapper(*args, **kwargs): username = input('username:').strip() password = input('password:').strip() if username == 'admin' and password == '123': func() else: exit() return wrapper@authdef index(): print('index')@authdef home(): print('home')@authdef bbs(): print('bbs')# 方法調用index()home()bbs()