Flask接口签名sign原理与实例代码浅析
277
2022-08-28
基于python的饭店点餐外卖管理系统#毕业设计(点餐程序python)
开发环境
项目编号:py228基于python的饭店点餐外卖管理系统#毕业设计 开发语言:Python python框架:django 软件版本:python3.7/python3.8 数据库:mysql 5.7或更高版本 数据库工具:Navicat11 开发软件:PyCharm/vs code 前端框架:vue.js
项目介绍
系统截图
关键代码
def orders_register(request): if request.method in ["POST", "GET"]: msg = {'code': normal_code, "msg": mes.normal_code} req_dict = request.session.get("req_dict") error = orders.createbyreq(orders, orders, req_dict) if error != None: msg['code'] = crud_error_code msg['msg'] = "用户已存在,请勿重复注册!" return JsonResponse(msg)def orders_login(request): if request.method in ["POST", "GET"]: msg = {'code': normal_code, "msg": mes.normal_code} req_dict = request.session.get("req_dict") datas = orders.getbyparams(orders, orders, req_dict) if not datas: msg['code'] = password_error_code msg['msg'] = mes.password_error_code return JsonResponse(msg) try: __sfsh__= orders.__sfsh__ except: __sfsh__=None if __sfsh__=='是': if datas[0].get('sfsh')=='否': msg['code']=other_code msg['msg'] = "账号已锁定,请联系管理员审核!" return JsonResponse(msg) req_dict['id'] = datas[0].get('id') return Auth.authenticate(Auth, orders, req_dict)def orders_logout(request): if request.method in ["POST", "GET"]: msg = { "msg": "登出成功", "code": 0 } return JsonResponse(msg)def orders_resetPass(request): ''' ''' if request.method in ["POST", "GET"]: msg = {"code": normal_code, "msg": mes.normal_code} req_dict = request.session.get("req_dict") error = orders.updatebyparams(orders,orders, req_dict) if error != None: msg['code'] = crud_error_code msg['msg'] = error return JsonResponse(msg)def orders_session(request): ''' ''' if request.method in ["POST", "GET"]: msg = {"code": normal_code,"msg": mes.normal_code, "data": {}} req_dict={"id":request.session.get('params').get("id")} msg['data'] = orders.getbyparams(orders, orders, req_dict)[0] return JsonResponse(msg)def orders_default(request): if request.method in ["POST", "GET"]: msg = {"code": normal_code,"msg": mes.normal_code, "data": {}} req_dict = request.session.get("req_dict") req_dict.update({"isdefault":"是"}) data=orders.getbyparams(orders, orders, req_dict) if len(data)>0: msg['data'] = data[0] else: msg['data'] = {} return JsonResponse(msg)def orders_page(request): ''' ''' if request.method in ["POST", "GET"]: msg = {"code": normal_code, "msg": mes.normal_code, "data":{"currPage":1,"totalPage":1,"total":1,"pageSize":10,"list":[]}} req_dict = request.session.get("req_dict") #获取全部列名 columns= orders.getallcolumn( orders, orders) #当前登录用户所在表
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~