From bfc02d9cd38ccdeb09b3a1f2545e1c75cdf39b29 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期四, 14 五月 2026 18:01:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_浪潮' into dev_浪潮
---
src/plugins/download.js | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/src/plugins/download.js b/src/plugins/download.js
index 2705310..e59d41a 100644
--- a/src/plugins/download.js
+++ b/src/plugins/download.js
@@ -1,4 +1,4 @@
-锘縤mport axios from "axios";
+import axios from "axios";
import { ElLoading, ElMessage } from "element-plus";
import { saveAs } from "file-saver";
import { getToken } from "@/utils/auth";
@@ -82,6 +82,16 @@
saveAs(text, name, opts) {
saveAs(text, name, opts);
},
+ byUrl(url, filename) {
+ // 灏哢RL涓殑preview鏇挎崲鎴恉ownload
+ const downloadUrl = url.replace(/preview/g, 'download')
+ const link = document.createElement('a')
+ link.href = downloadUrl
+ link.download = filename || ''
+ document.body.appendChild(link)
+ link.click()
+ document.body.removeChild(link)
+ },
async printErrMsg(data) {
const resText = await data.text();
const rspObj = JSON.parse(resText);
--
Gitblit v1.9.3