for循环执行一次就不执行了,数组长度有3,但是只执行第一次

for循环执行一次就不执行了,数组长度3,但是只执行第一次

submitSupply() {
      this.$refs["supplyForm"].validate((valid) => {
        let arr = this.supplyForm.errCode.replace(/[,]/g, ",").split(",");
        if (valid) {
          supplyPost.call(this, arr);
        } else {
          return false;
        }
      });
async function supplyPost(errCodeArray) {
        for (let index = 0; index < errCodeArray.length; index++) {
          try {
            let params = {
                startTime: this.supplyForm.startTime,
                endTime: this.supplyForm.endTime,
                repeatChId: this.supplyForm.repeatChId,
                errCode: errCodeArray[index],
              },
              ajaxType = "Ajax2",
              url = Api.createSupply;
            let res = await window[ajaxType](url, params);
            this.$message.success(res.message);
          } catch (err) {}
        }
        this.showSupply = false;
      }
    },

  • 打印一下err看看,第一次处理是不是报错了

可以调试输出确认下数据:errCodeArray