فهرست منبع

feat: indent登录过期调整登录页.

peter 3 ماه پیش
والد
کامیت
d15d1cfe4c
1فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 13 0
      src/utils/axios2.js

+ 13 - 0
src/utils/axios2.js

@@ -59,6 +59,19 @@ request.interceptors.response.use(
   },
   (error) => {
     console.log('error: ', error.response)
+    if (error.response.status === 303) {
+      Cookie.set('indent-token', '')
+      Cookie.set('indent-crm-id', '')
+      Cookie.set('indent-crm-fullname', '')
+      Cookie.set('indent-crm-id', '')
+      ElNotification({
+        message: '登录状态过期,请重新登录',
+        type: 'error',
+        duration: 3 * 1000,
+      })
+      window.location.href = '/indent-manage/login'
+      return
+    }
     const { data } = error.response
     if (typeof data.msg === 'undefined') {
       ElNotification({