im-ui-mobile 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/im-cell-switch/im-cell-switch.vue +1 -1
- package/components/im-upload/im-upload.vue +5 -0
- package/package.json +1 -1
- package/types/components/upload.d.ts +2 -6
- package/components/im-upload-/im-upload.vue +0 -1190
- package/components/im-upload-/utils/file-adapter.js +0 -214
- package/components/im-upload-/utils/file-adapter.ts +0 -214
- package/components/im-upload-/utils/file-chooser.js +0 -67
- package/components/im-upload-/utils/file-chooser.ts +0 -69
- package/components/im-upload-/utils/file-validator.js +0 -306
- package/components/im-upload-/utils/file-validator.ts +0 -214
- package/components/im-upload-/utils/upload.js +0 -227
- package/components/im-upload-/utils/upload.ts +0 -228
|
@@ -519,6 +519,11 @@ const startUpload = async (uploadFile: UploadFile) => {
|
|
|
519
519
|
throw new Error('请设置上传地址或自定义上传函数')
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
+
// 服务端失败
|
|
523
|
+
if (response.statusCode !== 200) {
|
|
524
|
+
throw new Error(response.data.error.message)
|
|
525
|
+
}
|
|
526
|
+
|
|
522
527
|
// 格式化响应数据
|
|
523
528
|
const formattedResponse = props.responseFormatter(response)
|
|
524
529
|
|
package/package.json
CHANGED
|
@@ -86,9 +86,6 @@ declare interface UploadProps {
|
|
|
86
86
|
|
|
87
87
|
// 上传组件方法
|
|
88
88
|
declare interface UploadMethods {
|
|
89
|
-
// 手动上传文件
|
|
90
|
-
upload: (file: Object) => Promise<void>
|
|
91
|
-
|
|
92
89
|
// 清空文件列表
|
|
93
90
|
clearFiles: () => void
|
|
94
91
|
|
|
@@ -110,15 +107,14 @@ declare interface _Upload {
|
|
|
110
107
|
'update:modelValue': (files: UploadFile[]) => void
|
|
111
108
|
'change': (files: UploadFile[]) => void
|
|
112
109
|
'select': (file: Object) => void
|
|
113
|
-
'upload': (file: UploadFile) => void
|
|
114
110
|
'success': (response: any, file: UploadFile) => void
|
|
115
111
|
'error': (error: Error, file: UploadFile) => void
|
|
116
112
|
'progress': (percent: number, file: UploadFile) => void
|
|
117
113
|
'remove': (file: UploadFile, index: number) => void
|
|
118
114
|
'preview': (file: UploadFile) => void
|
|
119
115
|
'exceed': (files: Object[]) => void
|
|
120
|
-
'
|
|
121
|
-
'
|
|
116
|
+
'uploading': (file: UploadFile) => void
|
|
117
|
+
'uploaded': (file: UploadFile) => void
|
|
122
118
|
}
|
|
123
119
|
} & UploadMethods
|
|
124
120
|
}
|