From 8a857fe1b0b69dafbdaa15b45edab03a2c3bcdb2 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期二, 09 七月 2024 09:52:47 +0800 Subject: [PATCH] 成员管理表格查询 增删改 分配成员 统计 下载导入模板 --- Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue b/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue index dc1c5b1..6b73c7c 100644 --- a/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue +++ b/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue @@ -118,14 +118,13 @@ async beforeUpload(file) { // 鑾峰彇鏂囦欢鎵╁睍鍚� const fileExtension = file.name.split(".").pop().toLowerCase(); // 杞崲涓哄皬鍐欎互閬垮厤澶у皬鍐欎笉鍖归厤鐨勯棶棰� - const allowedExtensions = this.paramVOS.fileType || ['css', 'csv', 'doc', 'gif', 'html', 'jpe', 'jpg', 'jpeg', 'png', 'js', 'json', - 'mp3', 'mp4', 'xlsx', 'xml', 'zip', 'xhtml', 'wps', 'ppt', 'xls', 'word', 'pdf', 'txt']; - // 妫�鏌ユ枃浠舵墿灞曞悕鏄惁鍦ㄥ厑璁哥殑鏂囦欢鎵╁睍鍚嶆暟缁勪腑 - if (!allowedExtensions.includes(fileExtension)) { - // 涓婁紶鏍煎紡涓嶇鍚堣姹傦紝鎻愮ず閿欒淇℃伅骞跺彇娑堜笂浼� - this.$message.error(`鍙厑璁镐笂浼�${allowedExtensions.toString()}鏍煎紡鐨勬枃浠禶); - return Promise.reject(false); + if(this.paramVOS.fileType){ + if (!this.paramVOS.fileType.includes(fileExtension)) { + // 涓婁紶鏍煎紡涓嶇鍚堣姹傦紝鎻愮ず閿欒淇℃伅骞跺彇娑堜笂浼� + this.$message.error(`鍙厑璁镐笂浼�${this.paramVOS.fileType.toString()}鏍煎紡鐨勬枃浠禶); + return Promise.reject(false); + } } this.pageLoading = this.$loading({ -- Gitblit v1.9.3