| | |
| | | // Props 定义 |
| | | const props = defineProps({ |
| | | modelValue: [String, Object, Array], |
| | | action: { type: String, default: "/common/minioUploads" }, |
| | | action: { type: String, default: "/common/commonUploads" }, |
| | | data: { type: Object }, |
| | | limit: { type: Number, default: 5 }, |
| | | fileSize: { type: Number, default: 10 }, // 默认10MB,适合视频 |
| | |
| | | isShowTip: { type: Boolean, default: true }, |
| | | disabled: { type: Boolean, default: false }, |
| | | drag: { type: Boolean, default: false }, // 拍照不需要拖拽 |
| | | statusType: { type: Number, default: "" }, // 用于区分不同状态的上传 |
| | | type: { type: Number, default: "" }, // 用于区分不同状态的上传 |
| | | maxVideoDuration: { type: Number, default: 30 }, // 最大视频时长(秒) |
| | | }); |
| | | |
| | |
| | | const testServerConnection = () => { |
| | | return new Promise((resolve) => { |
| | | uni.request({ |
| | | url: uploadFileUrl.value.replace('/common/minioUploads', '/common/test'), |
| | | url: uploadFileUrl.value.replace('/common/commonUploads', '/common/commonUploads'), |
| | | method: 'GET', |
| | | timeout: 5000, |
| | | success: (res) => { |
| | |
| | | filePath: filePath, |
| | | name: 'files', |
| | | formData: { |
| | | type: props.statusType || 0, |
| | | type: props.type || 0, |
| | | ...(props.data || {}) |
| | | }, |
| | | header: { |