haoxuan
2023-08-28 4436c040d89980c8624f88cd4876c808806c414f
src/utils/request.js
@@ -38,20 +38,20 @@
      return res.data ? res.data : {};
    } else {
      if(!res.config.loadingFlag){
        // Message({
        //   // message: res.data.msg==res.data.data?res.data.data:res.data.msg+','+res.data.data,
        //   message: res.data.msg,
        //   type: 'error',
        //   duration: 5 * 1000
        // })
        MessageBox.confirm( res.data.msg+"?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        Message({
          // message: res.data.msg==res.data.data?res.data.data:res.data.msg+','+res.data.data,
          message: res.data.msg,
          type: 'error',
          duration: 5 * 1000
        })
          .then(() => {
          })
          .catch(() => {});
        // MessageBox.confirm( res.data.msg+"?", "提示", {
        //   confirmButtonText: "确定",
        //   cancelButtonText: "取消",
        //   type: "warning",
        // })
        //   .then(() => {
        //   })
        //   .catch(() => {});
      }
      return res.data ? res.data : {};
    }
@@ -65,18 +65,18 @@
    } else if (message.includes('Request failed with status code')) {
      message = '系统接口' + message.substr(message.length - 3) + '异常'
    }
    // Message({
    //   message: message,
    //   type: 'error',
    //   duration: 5 * 1000
    // })
    MessageBox.confirm( message+"?", "提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    Message({
      message: message,
      type: 'error',
      duration: 5 * 1000
    })
      .then(() => {})
      .catch(() => {});
    // MessageBox.confirm( message+"?", "提示", {
    //   confirmButtonText: "确定",
    //   cancelButtonText: "取消",
    //   type: "warning",
    // })
    //   .then(() => {})
    //   .catch(() => {});
    return Promise.reject(error)
  }
)