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