From dae8c5016c0b8894119618754acfe509123d2f91 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期三, 30 四月 2025 10:29:32 +0800
Subject: [PATCH] 上传组件新增拖动排序属性
---
src/plugins/download.js | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/plugins/download.js b/src/plugins/download.js
index d0f6b56..82e26ed 100644
--- a/src/plugins/download.js
+++ b/src/plugins/download.js
@@ -6,7 +6,7 @@
import { blobValidate } from '@/utils/ruoyi'
const baseURL = import.meta.env.VITE_APP_BASE_API
-let downloadLoadingInstance;
+let downloadLoadingInstance
export default {
name(name, isDelete = true) {
@@ -17,29 +17,29 @@
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then((res) => {
- const isBlob = blobValidate(res.data);
+ const isBlob = blobValidate(res.data)
if (isBlob) {
const blob = new Blob([res.data])
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
} else {
- this.printErrMsg(res.data);
+ this.printErrMsg(res.data)
}
})
},
resource(resource) {
- var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource);
+ var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource)
axios({
method: 'get',
url: url,
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then((res) => {
- const isBlob = blobValidate(res.data);
+ const isBlob = blobValidate(res.data)
if (isBlob) {
const blob = new Blob([res.data])
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
} else {
- this.printErrMsg(res.data);
+ this.printErrMsg(res.data)
}
})
},
@@ -52,28 +52,28 @@
responseType: 'blob',
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then((res) => {
- const isBlob = blobValidate(res.data);
+ const isBlob = blobValidate(res.data)
if (isBlob) {
const blob = new Blob([res.data], { type: 'application/zip' })
this.saveAs(blob, name)
} else {
- this.printErrMsg(res.data);
+ this.printErrMsg(res.data)
}
- downloadLoadingInstance.close();
+ downloadLoadingInstance.close()
}).catch((r) => {
console.error(r)
ElMessage.error('涓嬭浇鏂囦欢鍑虹幇閿欒锛岃鑱旂郴绠$悊鍛橈紒')
- downloadLoadingInstance.close();
+ downloadLoadingInstance.close()
})
},
saveAs(text, name, opts) {
- saveAs(text, name, opts);
+ saveAs(text, name, opts)
},
async printErrMsg(data) {
- const resText = await data.text();
- const rspObj = JSON.parse(resText);
+ const resText = await data.text()
+ const rspObj = JSON.parse(resText)
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
- ElMessage.error(errMsg);
+ ElMessage.error(errMsg)
}
}
--
Gitblit v1.9.3