fix(UploadMedia): 仅对图片文件进行10MB大小限制检查
视频文件不再受大小限制,仅当上传图片且超过10MB时显示错误提示
Showing
1 changed file
with
3 additions
and
3 deletions
| ... | @@ -200,10 +200,10 @@ const chooseMedia = () => { | ... | @@ -200,10 +200,10 @@ const chooseMedia = () => { |
| 200 | success: async (res) => { | 200 | success: async (res) => { |
| 201 | const file = res.tempFiles[0]; | 201 | const file = res.tempFiles[0]; |
| 202 | 202 | ||
| 203 | - // 检查文件大小(10MB限制) | 203 | + // 检查文件大小(仅对图片进行10MB限制,视频不检查大小) |
| 204 | - if (file.size > 10 * 1024 * 1024) { | 204 | + if (file.fileType === 'image' && file.size > 10 * 1024 * 1024) { |
| 205 | Taro.showToast({ | 205 | Taro.showToast({ |
| 206 | - title: '文件大小不能超过10MB', | 206 | + title: '图片大小不能超过10MB', |
| 207 | icon: 'none', | 207 | icon: 'none', |
| 208 | duration: 2000 | 208 | duration: 2000 |
| 209 | }); | 209 | }); | ... | ... |
-
Please register or login to post a comment