diff --git a/src/utils/http/index.ts b/src/utils/http/index.ts index ab0f1d6..a7cf5a1 100644 --- a/src/utils/http/index.ts +++ b/src/utils/http/index.ts @@ -163,6 +163,14 @@ class PureHttp { resolve(response); }) .catch(error => { + if (error.response.status === 401) { + router.replace({ + path: "/login", + query: { + redirect: router.currentRoute.value.fullPath + } + }); + } if (error.response === null || error.response === undefined) { message(error.message, { type: "error" }); } else {