sadais-piui 1.2.7-beta105 → 1.2.7-beta106

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.
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2021-08-13 11:31:57
4
- * @LastEditTime: 2024-05-24 15:19:19
4
+ * @LastEditTime: 2024-05-29 10:09:04
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 图片上传组件
7
7
  * @FilePath: /piui-awesome/src/piui/components/pi-upload-img/index.vue
@@ -560,6 +560,9 @@ export default {
560
560
  current = this.imgField ? img[this.imgField] : img
561
561
  }
562
562
 
563
+ // 过滤出图片类型的文件
564
+ urls = urls.filter(url => isImageFilename(url))
565
+
563
566
  // eslint-disable-next-line no-undef
564
567
  uni.previewImage({
565
568
  urls,
@@ -759,6 +762,11 @@ export default {
759
762
  if (errMsg !== 'chooseMessageFile:ok') {
760
763
  throw new Error(errMsg)
761
764
  }
765
+ // chooseMessageFile 没有扩展名限制,这里自己做过滤
766
+ tempFiles = tempFiles.filter(file => {
767
+ const ext = file.name.split('.').pop()
768
+ return this.getChooseFileOpts.extension.includes(ext)
769
+ })
762
770
  this.handleUpload(tempFiles)
763
771
  } catch (error) {
764
772
  console.log(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta105",
3
+ "version": "1.2.7-beta106",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {