def loginValid(func):
    '\n    :desc 闭包函数校验是否登录\n    :param func:\n    :return:\n    '

    def inner(request, *args, **kwargs):
        email = request.COOKIES.get('user')
        s_email = request.session.get('user')
        if (email and s_email and (email == s_email)):
            user = LoginUser.objects.filter(email=email).first()
            if user:
                return func(request, *args, **kwargs)
        return HttpResponseRedirect('/Buyer/login/')
    return inner
:desc 闭包函数校验是否登录
:param func:
:return:
def loginValid(func):
    '\n    :desc 闭包函数校验是否登录\n    :param func:\n    :return:\n    '

    def inner(request, *args, **kwargs):
        email = request.COOKIES.get('user')
        s_email = request.session.get('user')
        if (email and s_email and (email == s_email)):
            user = LoginUser.objects.filter(email=email).first()
            if user:
                return func(request, *args, **kwargs)
        return HttpResponseRedirect('/Buyer/login/')
    return inner