def local_backup(): # types = request.json.get('types', None) #备份类型;支付邮箱等系统配置;商品分类及卡密备份;历史订单备份 # print(request.args) types = request.args.get('types', None) # print(type(types)) try: types = int(types) except: return '需要int参数', 400 if not types or types not in [1, 2, 3]: return '参数丢失', 400 try: if types == 1: # 支付邮箱系统配置 msg = loc_sys_back() elif types == 2: # 卡密备份 msg = loc_shop_back() else: # 历史订单备份 msg = loc_order_back() res = make_response(msg) filename = '4545' #失效 res.headers[ "Content-Disposition"] = f"p_w_upload; filename={filename}.txt" return res except Exception as e: log(e) return '导出失败', 400
def local_backup(): types = request.json.get('types', None) #备份类型;支付邮箱等系统配置;商品分类及卡密备份;历史订单备份 print(type(types)) if not types or types not in [1, 2, 3]: return '参数丢失', 400 try: if types == 1: # 支付邮箱系统配置 msg = loc_sys_back() elif types == 2: # 卡密备份 msg = loc_shop_back() else: # 历史订单备份 msg = loc_order_back() return {"msg": msg}, 200 except Exception as e: log(e) return {"msg": '导出失败'}, 400