From 68ff1df47ebfc20c0c592aeb9140d9cf97c90d4f Mon Sep 17 00:00:00 2001 From: lingsoul <908707246@qq.com> Date: Wed, 3 Jan 2024 09:26:02 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drequest.js=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=8F=90=E7=A4=BA=E8=AF=AF=E8=A7=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lingsoul <908707246@qq.com> --- snowy-admin-web/src/utils/request.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snowy-admin-web/src/utils/request.js b/snowy-admin-web/src/utils/request.js index ee6aba65..cd756acd 100644 --- a/snowy-admin-web/src/utils/request.js +++ b/snowy-admin-web/src/utils/request.js @@ -108,7 +108,7 @@ service.interceptors.response.use( // } } else { // 统一成功提示 - const responseUrl = response.config.url + const responseUrls = response.config.url.split('/') const apiNameArray = [ 'add', 'edit', @@ -129,7 +129,7 @@ service.interceptors.response.use( 'saveDraft' ] apiNameArray.forEach((apiName) => { - if (responseUrl.endsWith(apiName)) { + if (responseUrls[responseUrls.length - 1].includes(apiName)) { message.success(data.msg) } })