async uploadImg(file) {
   let formData= new FormData();
   formData.append("photo", file);
   const { data: data } = await uploadProductPicture(formData);
   console.log(data);
   this.imgName.push(data);
 },




async updateGood(state) {
      for (let i = 0; i < this.file.length; i++) {
      //MVP: await
        await this.uploadImg(this.file[i]);
      }
      console.log(this.oldPhoto.concat(this.imgName));
      const res = await updateBasicsProduct({
        id: this.goodId,
        name: this.newName,
        schoolId: this.newSchool,
        areaId: this.newArea,
        photos: this.oldPhoto.concat(this.imgName)
      });
      // console.log(res);
      if (res.code === 200) {
        this.$Message["success"]({
          background: true,
          content: "修改成功"
        });
        this.$router.push("/goods");
      }
    }
Logo

这里是“一人公司”的成长家园。我们提供从产品曝光、技术变现到法律财税的全栈内容,并连接云服务、办公空间等稀缺资源,助你专注创造,无忧运营。

更多推荐