File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
ruoyi-fastapi-frontend/src/components Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 55 :action =" uploadFileUrl"
66 :before-upload =" handleBeforeUpload"
77 :file-list =" fileList"
8+ :data =" data"
89 :limit =" limit"
910 :on-error =" handleUploadError"
1011 :on-exceed =" handleExceed"
@@ -48,6 +49,15 @@ export default {
4849 props: {
4950 // 值
5051 value: [String , Object , Array ],
52+ // 上传接口地址
53+ action: {
54+ type: String ,
55+ default: " /common/upload"
56+ },
57+ // 上传携带的参数
58+ data: {
59+ type: Object
60+ },
5161 // 数量限制
5262 limit: {
5363 type: Number ,
@@ -79,7 +89,7 @@ export default {
7989 number: 0 ,
8090 uploadList: [],
8191 baseUrl: process .env .VUE_APP_BASE_API ,
82- uploadFileUrl: process .env .VUE_APP_BASE_API + " /common/upload " , // 上传文件服务器地址
92+ uploadFileUrl: process .env .VUE_APP_BASE_API + this . action , // 上传文件服务器地址
8393 headers: {
8494 Authorization: " Bearer " + getToken (),
8595 },
Original file line number Diff line number Diff line change 66 list-type =" picture-card"
77 :on-success =" handleUploadSuccess"
88 :before-upload =" handleBeforeUpload"
9+ :data =" data"
910 :limit =" limit"
1011 :on-error =" handleUploadError"
1112 :on-exceed =" handleExceed"
@@ -49,6 +50,15 @@ import { isExternal } from "@/utils/validate";
4950export default {
5051 props: {
5152 value: [String , Object , Array ],
53+ // 上传接口地址
54+ action: {
55+ type: String ,
56+ default: " /common/upload"
57+ },
58+ // 上传携带的参数
59+ data: {
60+ type: Object
61+ },
5262 // 图片数量限制
5363 limit: {
5464 type: Number ,
@@ -78,7 +88,7 @@ export default {
7888 dialogVisible: false ,
7989 hideUpload: false ,
8090 baseUrl: process .env .VUE_APP_BASE_API ,
81- uploadImgUrl: process .env .VUE_APP_BASE_API + " /common/upload " , // 上传的图片服务器地址
91+ uploadImgUrl: process .env .VUE_APP_BASE_API + this . action , // 上传的图片服务器地址
8292 headers: {
8393 Authorization: " Bearer " + getToken (),
8494 },
You can’t perform that action at this time.
0 commit comments