songshankun
2023-10-08 3d3b89a84fd8c3aa524c013afe56c6949fc3a874
src/utils/request.js
@@ -1,6 +1,6 @@
import axios from "axios";
import util from "@/libs/util.js";
import { Message } from "element-ui";
import { Message,MessageBox } from "element-ui";
// import router from '@/router'
@@ -42,8 +42,16 @@
          // 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
          duration: 3 * 1000
        })
        // MessageBox.confirm( res.data.msg+"?", "提示", {
        //   confirmButtonText: "确定",
        //   cancelButtonText: "取消",
        //   type: "warning",
        // })
        //   .then(() => {
        //   })
        //   .catch(() => {});
      }
      return res.data ? res.data : {};
    }
@@ -60,8 +68,15 @@
    Message({
      message: message,
      type: 'error',
      duration: 5 * 1000
      duration: 3 * 1000
    })
    // MessageBox.confirm( message+"?", "提示", {
    //   confirmButtonText: "确定",
    //   cancelButtonText: "取消",
    //   type: "warning",
    // })
    //   .then(() => {})
    //   .catch(() => {});
    return Promise.reject(error)
  }
)