From 5c40c4b9586aff0dbfa11de2ad5d0d45600bec4a Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 02 六月 2021 10:09:09 +0800
Subject: [PATCH] update 文档增加 Oracle 分支路径配置
---
ruoyi-ui/src/utils/zipdownload.js | 80 ++++++++++++++++++++--------------------
1 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/ruoyi-ui/src/utils/zipdownload.js b/ruoyi-ui/src/utils/zipdownload.js
index ac2745b..fff4873 100644
--- a/ruoyi-ui/src/utils/zipdownload.js
+++ b/ruoyi-ui/src/utils/zipdownload.js
@@ -1,40 +1,40 @@
-import axios from 'axios'
-import { getToken } from '@/utils/auth'
-
-const mimeMap = {
- xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- zip: 'application/zip'
-}
-
-const baseUrl = process.env.VUE_APP_BASE_API
-export function downLoadZip(str, filename) {
- var url = baseUrl + str
- axios({
- method: 'get',
- url: url,
- responseType: 'blob',
- headers: { 'Authorization': 'Bearer ' + getToken() }
- }).then(res => {
- resolveBlob(res, mimeMap.zip)
- })
-}
-/**
- * 瑙f瀽blob鍝嶅簲鍐呭骞朵笅杞�
- * @param {*} res blob鍝嶅簲鍐呭
- * @param {String} mimeType MIME绫诲瀷
- */
-export function resolveBlob(res, mimeType) {
- const aLink = document.createElement('a')
- var blob = new Blob([res.data], { type: mimeType })
- // //浠巖esponse鐨刪eaders涓幏鍙杅ilename, 鍚庣response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 璁剧疆鐨勬枃浠跺悕;
- var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
- var contentDisposition = decodeURI(res.headers['content-disposition'])
- var result = patt.exec(contentDisposition)
- var fileName = result[1]
- fileName = fileName.replace(/\"/g, '')
- aLink.href = URL.createObjectURL(blob)
- aLink.setAttribute('download', fileName) // 璁剧疆涓嬭浇鏂囦欢鍚嶇О
- document.body.appendChild(aLink)
- aLink.click()
- document.body.removeChild(aLink);
-}
+import axios from 'axios'
+import { getToken } from '@/utils/auth'
+
+const mimeMap = {
+ xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ zip: 'application/zip'
+}
+
+const baseUrl = process.env.VUE_APP_BASE_API
+export function downLoadZip(str, filename) {
+ var url = baseUrl + str
+ axios({
+ method: 'get',
+ url: url,
+ responseType: 'blob',
+ headers: { 'Authorization': 'Bearer ' + getToken() }
+ }).then(res => {
+ resolveBlob(res, mimeMap.zip)
+ })
+}
+/**
+ * 瑙f瀽blob鍝嶅簲鍐呭骞朵笅杞�
+ * @param {*} res blob鍝嶅簲鍐呭
+ * @param {String} mimeType MIME绫诲瀷
+ */
+export function resolveBlob(res, mimeType) {
+ const aLink = document.createElement('a')
+ var blob = new Blob([res.data], { type: mimeType })
+ // //浠巖esponse鐨刪eaders涓幏鍙杅ilename, 鍚庣response.setHeader("Content-disposition", "attachment; filename=xxxx.docx") 璁剧疆鐨勬枃浠跺悕;
+ var patt = new RegExp('filename=([^;]+\\.[^\\.;]+);*')
+ var contentDisposition = decodeURI(res.headers['content-disposition'])
+ var result = patt.exec(contentDisposition)
+ var fileName = result[1]
+ fileName = fileName.replace(/\"/g, '')
+ aLink.href = URL.createObjectURL(blob)
+ aLink.setAttribute('download', fileName) // 璁剧疆涓嬭浇鏂囦欢鍚嶇О
+ document.body.appendChild(aLink)
+ aLink.click()
+ document.body.removeChild(aLink);
+}
--
Gitblit v1.9.3