From 41de169dd2a527a1adb9a4e621999d1d3efd93f6 Mon Sep 17 00:00:00 2001
From: 抓蛙师 <770492966@qq.com>
Date: 星期一, 30 八月 2021 11:29:33 +0800
Subject: [PATCH] 全量保存或更新时判断数组长度再继续
---
ruoyi-ui/src/utils/download.js | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/ruoyi-ui/src/utils/download.js b/ruoyi-ui/src/utils/download.js
index 8a2d808..52b07f7 100644
--- a/ruoyi-ui/src/utils/download.js
+++ b/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)
})
}
--
Gitblit v1.9.3