From a5e490fbe5dd6f253bd81d80e141fef0c0df2cae Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期一, 28 十一月 2022 11:47:28 +0800
Subject: [PATCH] fix: 修改右上角密码修改
---
src/utils/helper.js | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/utils/helper.js b/src/utils/helper.js
index 77baab7..621af9a 100644
--- a/src/utils/helper.js
+++ b/src/utils/helper.js
@@ -2,7 +2,7 @@
// 娣辨嫹璐�
export function deepClone(obj) {
let objClone = Array.isArray(obj) ? [] : {};
- if (obj && typeof obj === 'object' && obj != null) {
+ if (obj && typeof obj === 'object') {
for (let key in obj) {
if (obj.hasOwnProperty(key)) {
if (obj[key] && typeof obj[key] === 'object') {
@@ -49,18 +49,18 @@
// data: 鏂囦欢, contentDisposition锛氳姹傚ご涓枃浠剁殑鍚嶅瓧
// 榛樿涓嶇敤淇敼锛岀洿鎺ュ皢杩斿洖鐨剅es浼犲叆鍗冲彲
export function downloadFile(res) {
- const blob = new Blob([res.data], { type: '.xlsx' });
+ const blob = new Blob([res.data], { type: 'application/octet-stream' });
const fileName = res.contentDisposition.split(`''`)[1];
if (window.navigator && window.navigator.msSaveBlob) {
- navigator.msSaveBlob(blob, fileName);
+ window.navigator.msSaveBlob(blob, fileName);
} else {
const link = document.createElement('a');
link.style.display = 'none';
- link.href = URL.createObjectURL(blob);
- link.setAttribute('download', decodeURI(fileName));
+ link.href = window.URL.createObjectURL(blob);
+ link.download = decodeURI(fileName);
document.body.appendChild(link);
link.click();
- URL.revokeObjectURL(link.href);
+ window.URL.revokeObjectURL(link.href);
document.body.removeChild(link);
}
}
--
Gitblit v1.8.0