#view
This commit is contained in:
parent
23d2d43d3d
commit
2e8820508a
|
@ -48,6 +48,7 @@ def user_login(request):
|
|||
except CaptchaStore.DoesNotExist:
|
||||
messages.error(request, '验证码错误')
|
||||
return HttpResponseRedirect('/login/')
|
||||
print(username,password)
|
||||
if username is not None and password is not None:
|
||||
try:
|
||||
# user = authenticate(username=username, password=password)
|
||||
|
@ -61,7 +62,7 @@ def user_login(request):
|
|||
else:
|
||||
messages.error(request, '账号或密码错误,请您确认账号和密码')
|
||||
except:
|
||||
messages.error(request, '账号或密码错误,请您确认账号和密码')
|
||||
messages.error(request, '111')
|
||||
return render(request,'dashboard/login.html',{'hash_key':hash_key,'image_url':image_url})
|
||||
def user_logout(request):
|
||||
logout(request)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from django.shortcuts import render
|
||||
from django.http import HttpResponse, JsonResponse
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth import get_user_model, authenticate, login
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
# Create your views here.
|
||||
|
|
Loading…
Reference in New Issue