This commit is contained in:
2024-04-24 14:56:11 +08:00
parent 07bf68feaa
commit 303445c19b
6 changed files with 31 additions and 15 deletions

View File

@@ -53,8 +53,8 @@ const request = config => {
// console.log('token:','Bearer ' + getToAccess-Control-Allow-Originken());
// console.log('request:',storageBaseUrl + config.url,response);
if (error) {
console.log(error)
toast('后端接口连接异常')
showConfirm(error)
// toast('后端接口连接异常')
reject('后端接口连接异常')
return
}
@@ -72,10 +72,12 @@ const request = config => {
})
reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
toast(msg)
// toast(msg)
showConfirm(message)
reject('500')
} else if (code !== 200) {
toast(msg)
// toast(msg)
showConfirm(message)
reject(code)
}
resolve(res.data)
@@ -91,7 +93,8 @@ const request = config => {
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
toast(message)
// toast(message)
showConfirm(message)
reject(error)
})
})