From 831cfa4c439c6d073d706a82d2a439f8b1818498 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 18 十一月 2025 16:59:50 +0800
Subject: [PATCH] Merge branch 'new' of http://www.beijingsoft.cn:9090/r/smart-web into new
---
src/utils/tool.js | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/utils/tool.js b/src/utils/tool.js
index f16c025..35e56b0 100644
--- a/src/utils/tool.js
+++ b/src/utils/tool.js
@@ -1,8 +1,8 @@
/*
* @Descripttion: 宸ュ叿闆�
* @version: 1.2
- * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-10-08 18:04:17
+ * @LastEditors: 鏉庡枂(寮�鍙戠粍) lzhe@yxqiche.com
+ * @LastEditTime: 2025-11-18 16:55:36
*/
import CryptoJS from 'crypto-js';
@@ -18,7 +18,7 @@
console.log(hostname,port,pathname)
if (process.env.NODE_ENV=='development') {
- //var path = "120.46.212.231:85"; //濡傛灉鏄湰鍦拌仈璋冿紝鍐欐垚120.46.212.231:85锛屽彂鐗堝啓鎴恏ostname+":"+port;
+ //var path = "120.46.212.231:85/"; //濡傛灉鏄湰鍦拌仈璋冿紝鍐欐垚120.46.212.231:86锛屽彂鐗堝啓鎴恏ostname+":"+port;
var path = hostname+":"+port;
} else {
var path = hostname+":"+port;
@@ -271,5 +271,18 @@
return `${encodeURIComponent(key)}=${encodeURIComponent(obj[key])}`;
}).join('&');
}
-
+// 涓嬭浇鏂囦欢
+tool.downFile = function(link,fileName) {
+ const x = new XMLHttpRequest();
+ x.open('GET', link, true);
+ x.responseType = 'blob';
+ x.onload = function () {
+ const url = window.URL.createObjectURL(x.response);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = fileName;
+ a.click();
+ }
+ x.send();
+}
export default tool
--
Gitblit v1.9.3