疯狂的狮子li
2021-08-18 c91d33e4ab58bdee9d4328adc2248495cc656c25
ruoyi-ui/src/utils/download.js
@@ -4,7 +4,6 @@
const mimeMap = {
  xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  zip: 'application/zip',
  excel: 'application/vnd.ms-excel',
  oss: 'application/octet-stream'
}
@@ -43,9 +42,11 @@
      if (value !== null && typeof(value) !== "undefined") {
        if (typeof value === 'object') {
          for (const key of Object.keys(value)) {
            let params = propName + '[' + key + ']';
            var subPart = encodeURIComponent(params) + "=";
            urlparams += subPart + encodeURIComponent(value[key]) + "&";
            if (value[key] !== null && typeof (value[key]) !== 'undefined') {
              let params = propName + '[' + key + ']';
              let subPart = encodeURIComponent(params) + '=';
              urlparams += subPart + encodeURIComponent(value[key]) + '&';
            }
          }
        } else {
          urlparams += part + encodeURIComponent(value) + "&";
@@ -62,7 +63,7 @@
    responseType: 'blob',
    headers: { 'Authorization': 'Bearer ' + getToken() }
  }).then(res => {
    resolveBlob(res, mimeMap.excel)
    resolveBlob(res, mimeMap.xlsx)
  })
}