From b25a280ebbfc5ca2ea334f2c7e337376e4ffd1cd Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Tue, 17 Dec 2024 11:57:05 +0800
Subject: [PATCH] 优化TopNav内链菜单点击没有高亮(IB8WHJ)

---
 ruoyi-ui/src/components/FileUpload/index.vue |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue
index dc81851..7db68b5 100644
--- a/ruoyi-ui/src/components/FileUpload/index.vue
+++ b/ruoyi-ui/src/components/FileUpload/index.vue
@@ -118,9 +118,14 @@
         const fileExt = fileName[fileName.length - 1];
         const isTypeOk = this.fileType.indexOf(fileExt) >= 0;
         if (!isTypeOk) {
-          this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
+          this.$modal.msgError(`文件格式不正确,请上传${this.fileType.join("/")}格式文件!`);
           return false;
         }
+      }
+      // 校检文件名是否包含特殊字符
+      if (file.name.includes(',')) {
+        this.$modal.msgError('文件名不正确,不能包含英文逗号!');
+        return false;
       }
       // 校检文件大小
       if (this.fileSize) {
@@ -173,10 +178,11 @@
     },
     // 获取文件名称
     getFileName(name) {
+      // 如果是url那么取最后的名字 如果不是直接返回
       if (name.lastIndexOf("/") > -1) {
         return name.slice(name.lastIndexOf("/") + 1);
       } else {
-        return "";
+        return name;
       }
     },
     // 对象转成指定字符串分隔

--
Gitblit v1.9.3