From d5632a01c2632eb5a7d9a9554e3468accefc3cf7 Mon Sep 17 00:00:00 2001 From: ivamp Date: Fri, 20 Sep 2024 00:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=B8=A2=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/httpInterceptors.ts | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/plugins/httpInterceptors.ts b/src/plugins/httpInterceptors.ts index ed7f244..162bf5d 100644 --- a/src/plugins/httpInterceptors.ts +++ b/src/plugins/httpInterceptors.ts @@ -95,12 +95,22 @@ const response = { }, }); } else if (error.response.status === 500) { - dialog.error({ - title: "500 服务器错误", - content: () => { - return h(error500); - }, - }); + const m = error.response.data.error; + if (m) { + dialog.error({ + title: "500 服务器错误", + content: () => { + return m; + }, + }); + } else { + dialog.error({ + title: "500 服务器错误", + content: () => { + return h(error500); + }, + }); + } } return Promise.reject(error);