diff --git a/Python程序设计课程设计报告模板 2024年.doc b/Python程序设计课程设计报告模板 2024年.doc index 0720f77..53a1dff 100644 Binary files a/Python程序设计课程设计报告模板 2024年.doc and b/Python程序设计课程设计报告模板 2024年.doc differ diff --git a/project_manage/manage/__pycache__/views.cpython-312.pyc b/project_manage/manage/__pycache__/views.cpython-312.pyc index 1582982..8ae0863 100644 Binary files a/project_manage/manage/__pycache__/views.cpython-312.pyc and b/project_manage/manage/__pycache__/views.cpython-312.pyc differ diff --git a/project_manage/manage/views.py b/project_manage/manage/views.py index 92f273e..1b753f5 100644 --- a/project_manage/manage/views.py +++ b/project_manage/manage/views.py @@ -18,13 +18,13 @@ class CustomerLoginView(View): id = request.POST.get('id', "") customer_name = request.POST.get('customer_name', "") # print(id, customer_name) - # customer_list = customer.objects.filter(id=id, customer_name=customer_name) + customer_list = customer.objects.filter(id=id, customer_name=customer_name) # print(customer_list) - # if customer_list: - # print(type(customer_list[0])) - # request.session.clear() - # request.session['customer'] = customer_list[0].id - if id == '1' and customer_name == '张三': + if customer_list: + print(type(customer_list[0])) + request.session.clear() + request.session['customer'] = customer_list[0].id + # if id == '1' and customer_name == '张三': request.session['customer'] = '1' return HttpResponseRedirect('/customercenter/') else: @@ -40,14 +40,14 @@ class EmployeeLoginView(View): def post(self,request): id = request.POST.get('id',"") password = request.POST.get('password',"") - # employee_list =employee.objects.filter(id=id,password=password) - # if employee_list: - # request.session['employee'] = employee_list[0].name + employee_list =employee.objects.filter(id=id,password=password) + if employee_list: + request.session['employee'] = employee_list[0].id # request.session['employee_image'] = str(employee_list[0].img) - # return HttpResponseRedirect('/employeecenter/') - if id == '1' and password == '123': - request.session['employee'] = '123' return HttpResponseRedirect('/employeecenter/') + # if id == '1' and password == '123': + # request.session['employee'] = '123' + # return HttpResponseRedirect('/employeecenter/') else: return HttpResponseRedirect('/Employee_login/') diff --git a/project_manage/project_manage/__pycache__/urls.cpython-312.pyc b/project_manage/project_manage/__pycache__/urls.cpython-312.pyc index d407591..eddc767 100644 Binary files a/project_manage/project_manage/__pycache__/urls.cpython-312.pyc and b/project_manage/project_manage/__pycache__/urls.cpython-312.pyc differ