From cbcfabee2af5f68c9327b3ba939b11754313b5bf Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期三, 29 十一月 2023 12:38:45 +0800 Subject: [PATCH] 优化代码 --- ruoyi-ui/src/components/FileUpload/index.vue | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/src/components/FileUpload/index.vue b/ruoyi-ui/src/components/FileUpload/index.vue index 6c583cf..c7f6b0a 100644 --- a/ruoyi-ui/src/components/FileUpload/index.vue +++ b/ruoyi-ui/src/components/FileUpload/index.vue @@ -142,7 +142,7 @@ // 上传失败 handleUploadError(err) { this.$modal.msgError("上传文件失败,请重试"); - this.$modal.closeLoading() + this.$modal.closeLoading(); }, // 上传成功回调 handleUploadSuccess(res, file) { @@ -174,10 +174,11 @@ }, // 获取文件名称 getFileName(name) { + // 如果是url那么取最后的名字 如果不是直接返回 if (name.lastIndexOf("/") > -1) { return name.slice(name.lastIndexOf("/") + 1); } else { - return ""; + return name; } }, // 对象转成指定字符串分隔 -- Gitblit v1.9.2