修复request.js统一成功提示误触问题

Signed-off-by: lingsoul <908707246@qq.com>
pull/189/head
lingsoul 11 months ago committed by Gitee
parent 6f401347cc
commit 68ff1df47e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

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

Loading…
Cancel
Save