Lou
2024-03-21 dbb166f62385c54d7a80ed34ee2a7c4d4cb602e3
mixin/uploadMixinPicCheck.js
@@ -66,20 +66,19 @@
                     }, 1000)
                  } else {
                     // if (checkResult.errcode == '87014') {
                     wx.hideLoading();
                     wx.showModal({
                        content: '存在敏感内容,请更换图片',
                        showCancel: false,
                        confirmText: '明白了'
                     })
                     // } else {
                     //    wx.hideLoading();
                     //    wx.showModal({
                     //       content: '其他错误,稍后再试',
                     //       showCancel: false,
                     //       confirmText: '明白了'
                     //    })
                     // }
                     uni.hideLoading();
                     if (data.code == 201) {
                        uni.showModal({
                           title: '提示!',
                           content: '存在敏感内容,请更换图片',
                           showCancel: false,
                           confirmText: '明白了'
                        })
                        resolve(data)
                     } else {
                        this.$showTips(data.msg)
                     }
                  }
               }
            });
@@ -88,13 +87,10 @@
      //上传成功后对返回数据进行处理
      async afterReadImg(event, key = "images") {
         // console.log(key)
         // console.log(this.form[key]);
         this.showLoading()
         var that = this;
         // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
         let lists = [].concat(event.file)
         console.log("form====>", this.form);
         let fileListLen = this.form[key].length
         lists.map((item) => {
            this.form[key].push({
@@ -105,6 +101,11 @@
         })
         for (let i = 0; i < lists.length; i++) {
            const result = await this.uploadFilePromise(lists[i].url)
            console.log("result", result);
            if (result.code != 200) { //移除上传失败的图片
               that.form[key].splice(i, 1)
               return
            };
            that.form[key].splice(fileListLen, 1, Object.assign({}, {
               url: result.data.link,
               name: result.data.name