From 21a17945fad7eb9b68e53cf85025398119f2ee3c Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Wed, 29 Nov 2023 12:59:22 +0800
Subject: [PATCH] 优化代码
---
ruoyi-ui/src/components/FileUpload/index.vue | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue
index dc81851..1fab173 100644
--- a/ruoyi-ui/src/components/FileUpload/index.vue
+++ b/ruoyi-ui/src/components/FileUpload/index.vue
@@ -173,10 +173,11 @@
},
// 获取文件名称
getFileName(name) {
+ // 如果是url那么取最后的名字 如果不是直接返回
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1);
} else {
- return "";
+ return name;
}
},
// 对象转成指定字符串分隔
--
Gitblit v1.9.3