From 1d2c8378f7b84521cb513967bd25517da9376fb2 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Tue, 02 Sep 2025 13:26:33 +0800
Subject: [PATCH] 文件支持防盗链配置

---
 ruoyi-ui/src/views/system/user/index.vue |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue
index c7a3c1d..9d6e61c 100644
--- a/ruoyi-ui/src/views/system/user/index.vue
+++ b/ruoyi-ui/src/views/system/user/index.vue
@@ -546,6 +546,11 @@
     },
     // 提交上传文件
     submitFileForm() {
+      const file = this.$refs.upload.uploadFiles
+      if (!file || file.length === 0 || !file[0].name.toLowerCase().endsWith('.xls') && !file[0].name.toLowerCase().endsWith('.xlsx')) {
+        this.$modal.msgError("请选择后缀为 “xls”或“xlsx”的文件。")
+        return
+      }
       this.$refs.upload.submit()
     }
   }

--
Gitblit v1.9.3