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)}'})