Преглед на файлове

fix: 正确地打印错误信息

Jinyao преди 5 години
родител
ревизия
4433e1cfca
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 2
      src/utils/axios.ts

+ 1 - 2
src/utils/axios.ts

@@ -2,7 +2,6 @@
 import axios from 'axios';
 import { TokenDispatcher } from '@/store/dispatchers';
 import {ElMessage} from "element-plus";
-import {response} from "express";
 
 const { destroyToken } = TokenDispatcher;
 
@@ -44,7 +43,7 @@ _axios.interceptors.response.use(
     ElMessage({
       type: 'error',
       showClose: true,
-      message: '接口出错,错误信息:' + error.status + error.statusText
+      message: '接口出错,错误信息:' + error.message
     })
     Promise.reject(error)
   }