gaoluyang
6 天以前 b807a12b89dc9126bac49c02a3902bec758f4f9b
src/utils/request.js
@@ -36,6 +36,9 @@
      url = url.slice(0, -1);
      config.params = {};
      config.url = url;
      config.headers["responseType"] = config.headers["responseType"]
        ? config.headers["responseType"]
        : ""; // 让每个请求携带自定义token 请根据实际情况自行修改
    }
    if (
      !isRepeatSubmit &&
@@ -49,7 +52,7 @@
            : config.data,
        time: new Date().getTime(),
      };
      const requestSize = Object.keys(JSON.stringify(requestObj)).length; // 请求数据大小
      const requestSize =  new TextEncoder().encode(JSON.stringify(requestObj)).byteLength; // 请求数据大小
      const limitSize = 5 * 1024 * 1024; // 限制存放数据5M
      if (requestSize >= limitSize) {
        console.warn(
@@ -73,7 +76,7 @@
        if (
          s_data === requestObj.data &&
          requestObj.time - s_time < interval &&
          s_url === requestObj.url
          s_url === requestObj.url && s_url !== '/insOrderPlan/saveInsContext'
        ) {
          const message = "数据正在处理,请勿重复提交";
          console.warn(`[${s_url}]: ` + message);