def login_Check(func): def inner(request, *args, **kwargs): v = request.session.get('userinfo') if not v: return render(request, 'login.html') else: re = func(request, *args, **kwargs) return re return inner
def login_Check(func): def inner(request, *args, **kwargs): v = request.session.get('userinfo') if not v: return render(request, 'login.html') else: re = func(request, *args, **kwargs) return re return inner
转载于:https://www.cnblogs.com/bhx77/p/9122467.html