import time


def 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

@auth
def index():
print('index')

@auth
def home():
print('home')

@auth
def bbs():
print('bbs')


# 方法调用
index()
home()
bbs()
posted on 2019-06-26 16:01  Yihan_07  阅读(660)  评论(0编辑  收藏  举报