0

大家好,我正在使用keith wood倒计时,如何在用户登录后将默认倒计时设置为(14天)倒计时,即使用户注销或离开页面,倒计时仍然是多余的?

<div id="defaultCountdown"></div>
<script>
$(function () {
    var austDay = new Date();
    austDay = new Date(austDay.getFullYear() + 1, 1 - 1, 26);
    $('#defaultCountdown').countdown({until: austDay});
    $('#year').text(austDay.getFullYear());
});
</script>

这是我的意见.py

def profile(request):
    if request.method != 'POST':
        raise Http404('Only POSTs are allowed')
    try:
        m = User.objects.get(username=request.POST['username'])
        if m.password == request.POST['password']:
            aa = request.POST['username']
            request.session['member_id'] = m.id
            print(m.id)
            return render(request, 'profile.html')

    except User.DoesNotExist:
        messages.Warning(request, 'Incorrect Username or Password.')
    return render (request, "login.html")

请各位帮帮我

4

0 回答 0