Browse Source

change api

tags/v1.0.0^2
zhangtao 2 years ago
parent
commit
bff91aa634
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      src/utils/http/interceptors.js

+ 11
- 7
src/utils/http/interceptors.js View File

@@ -38,18 +38,15 @@ export function setupInterceptor(service) {
const { code } = response?.data
const { currentRoute } = router
switch (code) {
case -1:
$message.error(response.data.msg)
break
case 0:
if (method !== 'get') {
$message.success(response.data.msg)
}
break
case -1:
$message.error(response.data.msg)
break
case 10009:
$message.error(response.data.msg)
break
case 500:
case 400:
$message.error(response.data.msg)
break
case 401:
@@ -60,7 +57,14 @@ export function setupInterceptor(service) {
query: { ...currentRoute.query, redirect: currentRoute.path }
})
break
case 500:
$message.error(response.data.msg)
break
case 10009:
$message.error(response.data.msg)
break
default:
$message.error(response.data.msg)
break
}
return response?.data

Loading…
Cancel
Save