From 0ecc7892b2637e47c29487fe5ef7a497caeedb19 Mon Sep 17 00:00:00 2001
From: 李喆(开发组) <lzhe@yxqiche.com>
Date: 星期五, 14 三月 2025 09:32:14 +0800
Subject: [PATCH] 1

---
 src/utils/tool.js |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/utils/tool.js b/src/utils/tool.js
index 85cda09..233d20d 100644
--- a/src/utils/tool.js
+++ b/src/utils/tool.js
@@ -2,7 +2,7 @@
  * @Descripttion: 宸ュ叿闆�
  * @version: 1.2
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-06-17 18:21:44
+ * @LastEditTime: 2024-12-18 15:11:50
  */
 
 import CryptoJS from 'crypto-js';
@@ -15,8 +15,11 @@
 var hostname = window.location.hostname; // 鑾峰彇涓绘満鍚�
 var port = window.location.port; // 鑾峰彇绔彛鍙�
 var pathname = window.location.pathname; // 鑾峰彇璺緞鍚�
+
+console.log(hostname,port,pathname)
 if (process.env.NODE_ENV=='development') {
-	var path = "120.46.212.231:84";
+	//var path = "120.46.212.231:86";  //濡傛灉鏄湰鍦拌仈璋冿紝鍐欐垚120.46.212.231:86锛屽彂鐗堝啓鎴恏ostname+":"+port;
+	var path = hostname+":"+port;
 } else {
 	var path = hostname+":"+port;
 }
@@ -268,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