From 1d8522499d6052e3d389667db1aae46a23208831 Mon Sep 17 00:00:00 2001
From: cy <1664593601@qq.com>
Date: 星期四, 14 十二月 2023 13:05:01 +0800
Subject: [PATCH] feat: 去掉按钮权限
---
admin-web/src/utils/base.js | 42 +++++++++---------------------------------
1 files changed, 9 insertions(+), 33 deletions(-)
diff --git a/admin-web/src/utils/base.js b/admin-web/src/utils/base.js
index d4980c0..c3ef085 100644
--- a/admin-web/src/utils/base.js
+++ b/admin-web/src/utils/base.js
@@ -23,43 +23,19 @@
return getBaseUrl() + '/pc/fin/file/uploadMore'
}
-// 棰勮鏂囦欢
-export function previewDoc(obj) {
- const routeUrl = this.$router.resolve({url: '/webOffice/preview'})
- let url = obj.url
- const wordLIst = ['doc', 'docm', 'docx', 'docxf', 'dot', 'dotm', 'dotx', 'epub', 'fodt', 'fb2', 'htm', 'html', 'mht', 'odt', 'oform', 'ott', 'oxps', 'pdf', 'rtf', 'txt', 'djvu', 'xml', 'xps', 'csv', 'fods', 'ods', 'ots', 'xls', 'xlsb', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx', 'fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx']
- const arr = url.split('.')
- if (arr.length === 2) {
- if (wordLIst.includes(arr[arr.length - 1])) {
- if (obj.url.indexOf('http') !== 0) {
- url = SettingIplatform.ftpUrl + url
- }
- window.open(routeUrl.href + '?url=' + encodeURIComponent(url) + '&docName=' + encodeURIComponent(encodeURIComponent(obj.fileName)), '_blank')
- } else {
- Message.warning('鏂囦欢鏍煎紡涓嶆敮鎸侀瑙堬紒')
- }
- }
-}
// 涓嬭浇鏂囦欢
-export function downLoad(obj) {
- let url = obj.url
- if (obj.url.indexOf('http') !== 0) {
- url = SettingIplatform.ftpUrl + obj.url
+export function downLoad(url) {
+ let link = url
+ if (link.indexOf('http') !== 0) {
+ link = SettingIplatform.ftpUrl + url
}
- window.open(decodeURI(url))
- /* var doc = document.createElement('a')
- doc.href = url
- doc.download = filename
+ var doc = document.createElement('a')
+ doc.href = link
doc.target = '_blank'
- doc.click()*/
- /* const loading = Loading.service({
- lock: true,
- text: '姝e湪涓嬭浇...',
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- })
- download(obj.url, obj.name, null, loading)*/
+ doc.rel = "noreferrer noopener"
+ doc.click()
+ document.body.removeChild(doc);
}
// 涓婁紶鏂囦欢
--
Gitblit v1.9.1