|
|
|
@ -112,7 +112,7 @@ def dashboard(request, type): |
|
|
|
|
t = 6 |
|
|
|
|
if type == 'login': |
|
|
|
|
data = getData(username, t) |
|
|
|
|
table = Login.objects.filter(username=username).order_by('-login_time').all()[:30] |
|
|
|
|
table = Login.objects.order_by('-login_time').all()[:30] |
|
|
|
|
elif type == 'docs': |
|
|
|
|
data = getData(username, t, 'docs') |
|
|
|
|
table = Upload.objects.filter(username=username).order_by('-upload_time').all()[:100] |
|
|
|
@ -225,7 +225,6 @@ def getData(username, time, type='login'): |
|
|
|
|
data.update({str(date): videoUpload.objects.filter(video_time__startswith=date).count()}) |
|
|
|
|
elif type == 'package': |
|
|
|
|
data.update({str(date): packageUpload.objects.filter(package_time__startswith=date).count()}) |
|
|
|
|
print(data) |
|
|
|
|
return data |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -275,7 +274,6 @@ def checkTask(request, id): |
|
|
|
|
if request.method == 'POST': |
|
|
|
|
url = request.get_raw_uri().split('?')[0] |
|
|
|
|
if eval(request.COOKIES.get(f'sign{id}', '{}')).get('url') != url: |
|
|
|
|
print(request.COOKIES,url) |
|
|
|
|
task = Task.objects.get(id=id) |
|
|
|
|
jsondata = json.loads(task.task_content) |
|
|
|
|
jsondata['userlist'][request.GET.get('name')] = {'status': '已完成', 'update_time': str(datetime.datetime.now())} |
|
|
|
|