From 60e2d55a2304ed7b973ed7a9bd40f3a6fb242585 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Mon, 21 Apr 2025 13:28:32 +0800
Subject: [PATCH] 优化菜单搜索查询页
---
ruoyi-ui/src/components/ImageUpload/index.vue | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/ruoyi-ui/src/components/ImageUpload/index.vue b/ruoyi-ui/src/components/ImageUpload/index.vue
index f3370df..4966c65 100644
--- a/ruoyi-ui/src/components/ImageUpload/index.vue
+++ b/ruoyi-ui/src/components/ImageUpload/index.vue
@@ -6,6 +6,7 @@
list-type="picture-card"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
+ :data="data"
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
@@ -48,6 +49,15 @@
export default {
props: {
value: [String, Object, Array],
+ // 上传接口地址
+ action: {
+ type: String,
+ default: "/file/upload"
+ },
+ // 上传携带的参数
+ data: {
+ type: Object
+ },
// 图片数量限制
limit: {
type: Number,
@@ -76,7 +86,7 @@
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
- uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", // 上传的图片服务器地址
+ uploadImgUrl: process.env.VUE_APP_BASE_API + this.action, // 上传的图片服务器地址
headers: {
Authorization: "Bearer " + getToken(),
},
@@ -130,7 +140,11 @@
}
if (!isImg) {
- 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) {
--
Gitblit v1.9.3