antd 上传图片获取宽高

    handleBeforeUpload (file, fileList) {
      return new Promise(async (resolve, reject) => {
        const imageReg = /\.(gif|jpg|jpeg|png|webp|GIF|JPG|JPEG|PNG|WEBP)$/
        this.getFileWidthAndHeight(file)
        console.log(‘handleBeforeUpload...‘, this.params, file)
        if (imageReg.test(file.name)) {
          return this.GetUploadSinature(this.params).then(() => resolve())
        }
        const errText = ‘请选择图片上传‘
        this.$message.error(errText)
        // eslint-disable-next-line prefer-promise-reject-errors
        reject()
      })
    },

 

antd 上传图片获取宽高

上一篇:收藏一波:常用正则表达式公式总结(二)


下一篇:MySQL索引概述