From f4d12e4e5e5e874bbeac559b296966a1095e6a30 Mon Sep 17 00:00:00 2001 From: inori-333 Date: Mon, 3 Mar 2025 13:19:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B0=86Flask=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E5=85=81=E8=AE=B8=E7=9A=84=E6=9C=80=E5=A4=A7=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=BD=93=E7=A7=AF=E8=AE=BE=E7=BD=AE=E4=B8=BA128MB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/dashboard/server.py | 1 + 1 file changed, 1 insertion(+) diff --git a/astrbot/dashboard/server.py b/astrbot/dashboard/server.py index e3f28cb55..8177359dd 100644 --- a/astrbot/dashboard/server.py +++ b/astrbot/dashboard/server.py @@ -23,6 +23,7 @@ class AstrBotDashboard(): self.config = core_lifecycle.astrbot_config self.data_path = os.path.abspath(os.path.join(DATAPATH, "dist")) self.app = Quart("dashboard", static_folder=self.data_path, static_url_path="/") + self.app.config['MAX_CONTENT_LENGTH'] = 128 * 1024 * 1024 # 将Flask允许的最大上传文件体大小设置为128MB self.app.json.sort_keys = False self.app.before_request(self.auth_middleware) # token 用于验证请求 From bc06acdd25d39aa8775af9bfbd85c72a1b40c72f Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:10:47 +0800 Subject: [PATCH 2/2] chore: cleanup --- astrbot/dashboard/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/dashboard/server.py b/astrbot/dashboard/server.py index 8177359dd..26887c5b3 100644 --- a/astrbot/dashboard/server.py +++ b/astrbot/dashboard/server.py @@ -23,7 +23,7 @@ class AstrBotDashboard(): self.config = core_lifecycle.astrbot_config self.data_path = os.path.abspath(os.path.join(DATAPATH, "dist")) self.app = Quart("dashboard", static_folder=self.data_path, static_url_path="/") - self.app.config['MAX_CONTENT_LENGTH'] = 128 * 1024 * 1024 # 将Flask允许的最大上传文件体大小设置为128MB + self.app.config['MAX_CONTENT_LENGTH'] = 128 * 1024 * 1024 # 将 Flask 允许的最大上传文件体大小设置为 128 MB self.app.json.sort_keys = False self.app.before_request(self.auth_middleware) # token 用于验证请求 @@ -141,4 +141,4 @@ class AstrBotDashboard(): logger.info(display) - return self.app.run_task(host="0.0.0.0", port=port, shutdown_trigger=self.shutdown_trigger_placeholder) \ No newline at end of file + return self.app.run_task(host="0.0.0.0", port=port, shutdown_trigger=self.shutdown_trigger_placeholder)