支持文件&图片组件自定义地址&参数

This commit is contained in:
RuoYi 2025-04-18 12:55:58 +08:00
parent c6b0efcdc2
commit 0d9fb8b5c0
2 changed files with 22 additions and 2 deletions

View File

@ -5,6 +5,7 @@
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileList"
: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: "/common/upload"
},
//
data: {
type: Object
},
//
limit: {
type: Number,
@ -79,7 +89,7 @@ export default {
number: 0,
uploadList: [],
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
uploadFileUrl: process.env.VUE_APP_BASE_API + this.action, //
headers: {
Authorization: "Bearer " + getToken(),
},

View File

@ -6,6 +6,7 @@
list-type="picture-card"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:data="data"
:limit="limit"
:on-error="handleUploadError"
:on-exceed="handleExceed"
@ -49,6 +50,15 @@ import { isExternal } from "@/utils/validate";
export default {
props: {
value: [String, Object, Array],
//
action: {
type: String,
default: "/common/upload"
},
//
data: {
type: Object
},
//
limit: {
type: Number,
@ -78,7 +88,7 @@ export default {
dialogVisible: false,
hideUpload: false,
baseUrl: process.env.VUE_APP_BASE_API,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", //
uploadImgUrl: process.env.VUE_APP_BASE_API + this.action, //
headers: {
Authorization: "Bearer " + getToken(),
},