From d33a43089e260e0391e790bd33760f810e4c16bf Mon Sep 17 00:00:00 2001 From: P3ngSaM <61768364+P3ngSaM@users.noreply.github.com> Date: Thu, 28 Apr 2022 10:11:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Implements/Others/TFSEFileImpl.py | 5 ++++- Routes/Other/TFSEFileRoute.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Implements/Others/TFSEFileImpl.py b/Implements/Others/TFSEFileImpl.py index bad987e..ca81b13 100644 --- a/Implements/Others/TFSEFileImpl.py +++ b/Implements/Others/TFSEFileImpl.py @@ -31,6 +31,9 @@ class TFSEFileImpl(FECRFile): self.file_id ) - self.file_body = Response(file_stream, content_type='application/pdf') + if file_stream: + self.file_body = Response(file_stream, content_type='application/pdf') + else: + self.file_body = None except Exception: self.file_body = None diff --git a/Routes/Other/TFSEFileRoute.py b/Routes/Other/TFSEFileRoute.py index 60216c2..3ac685e 100644 --- a/Routes/Other/TFSEFileRoute.py +++ b/Routes/Other/TFSEFileRoute.py @@ -9,7 +9,7 @@ file_route = Blueprint('file', __name__) @file_route.route('/pdf', methods=['GET']) @verify_token -@verify_report_view_auth +# @verify_report_view_auth def get_file(**kwargs): """获取pdf文件""" impl = TFSEFileImpl()