diff --git a/front/src/utils/request.js b/front/src/utils/request.js index ed1a4e87..3a642879 100644 --- a/front/src/utils/request.js +++ b/front/src/utils/request.js @@ -109,7 +109,7 @@ instance.interceptors.response.use( } } console.log('已清除') - location.reload() + router.push({ path: '/login' }) } response['Access-Control-Expose-Headers'] = 'redirect' const { code, message } = response.data @@ -170,7 +170,7 @@ instance.interceptors.response.use( } } console.log('已清除') - location.reload() + router.push({ path: '/login' }) } if (response.headers.redirect) { window.location.href = response.headers.redirect