From 66382a5242c33ee9dd37802a33397d5492458312 Mon Sep 17 00:00:00 2001 From: zy123 <646228430@qq.com> Date: Sat, 15 Feb 2025 10:59:46 +0800 Subject: [PATCH] =?UTF-8?q?2.15=20=E7=A1=AE=E8=AE=A4=E9=9D=9E=E6=88=AA?= =?UTF-8?q?=E5=8F=96=E6=B3=84=E6=BC=8F=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flask_app/routes/test_preprocess.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flask_app/routes/test_preprocess.py b/flask_app/routes/test_preprocess.py index 992033f..46c13a2 100644 --- a/flask_app/routes/test_preprocess.py +++ b/flask_app/routes/test_preprocess.py @@ -23,7 +23,7 @@ def process_file(): file_url = data.get('file_url') # 参数校验 if not file_url: - return jsonify({'error': 'Missing file_url parameter'}), 400 + return jsonify({'error': 'Missing file_url parameter'}) # 生成唯一文件名 file_ext = '.pdf' @@ -41,7 +41,7 @@ def process_file(): # 处理结果 if not result: - return jsonify({'error': 'File processing failed'}), 500 + return jsonify({'error': 'File processing failed'}) # 构造响应数据(根据实际需要调整返回字段) response_data = { @@ -56,8 +56,8 @@ def process_file(): } } - return jsonify(response_data), 200 + return jsonify(response_data) except Exception as e: # app.logger.error(f"Processing error: {str(e)}") - return jsonify({'error': f'Internal server error: {str(e)}'}), 500 + return jsonify({'error': f'Internal server error: {str(e)}'})