When WeChat Mini Programs uploaded multiple pictures, formData also uploaded multiple times, and there were multiple records in the database. What are we going to do with it?

    upSingleImg: function () {
        var that = this;
        wx.uploadFile({
            url: url,
            filePath: that.data.arrImg[i],
            name: "image",
            formData: {
                ...
            },
            success: function (res) {
            },
            complete: function (complete) {
                iPP
                if (i == that.data.arrImg.length) {
                    i = 0;
                    wx.showModal({
                        content: "",
                        showCancel: false,
                        success:function(){
                            that.data.arrImg =[];
                            wx.navigateBack({
                                delta: 1
                            })
                        }
                    });
                } else if (i < that.data.arrImg.length) {//
                    console.log(`${i}`)
                    that.upSingleImg()
                }
            }
        })
    },
Feb.21,2022

what are the fields in your database like? does imageA,imageB,imageC exist in one field or in three fields?

Menu