gaoshp
2024-05-12 022e13de4490b06cc5be7d5a5fbe8ca0b29ef7fc
src/utils/request.js
@@ -35,11 +35,12 @@
axios.interceptors.response.use(
   (response) => {
      if (response.data.code && response.data.code !== 200) {
         ElNotification.error({
            title: '请求错误',
            message: response.data.msg
         });
         return Promise.reject(response);
         ElMessage({
            message: response.data.msg,
            type: 'warning',
         })
         return new Error()
         // return new Error();
      }
      return response;
   },
@@ -72,10 +73,10 @@
               }).catch(() => { })
            }
         } else {
            ElNotification.error({
               title: '请求错误',
               message: error.message || `Status:${error.response.status},未知错误!`
            });
            // ElNotification.error({
            //    title: '请求错误',
            //    message: error.message || `Status:${error.response.status},未知错误!`
            // });
         }
      } else {
         ElNotification.error({