Angular 角度-不从嵌套数组下载所有图像

Angular 角度-不从嵌套数组下载所有图像,angular,typescript,Angular,Typescript,我正在尝试将base64映像下载到本地计算机,但在检查第一个阵列后停止。它不会下载所有的图像 public getAllImages() { this.installationRequest.installations.forEach((drives: any) => { drives.phases.map((phase) => { phase.subjects.map((sub) => { console.log(s

我正在尝试将base64映像下载到本地计算机,但在检查第一个阵列后停止。它不会下载所有的图像

  public getAllImages() {
    this.installationRequest.installations.forEach((drives: any) => {
      drives.phases.map((phase) => {
        phase.subjects.map((sub) => {
          console.log(sub.base64Image);
          return this._http.get(sub.base64Image, { responseType: ResponseContentType.Blob }).map((res) => {
            return {
              filename: sub.imageName,
              data: res.blob(),
            };
          }).subscribe((result) => {
            const url = window.URL.createObjectURL(result.data);
            const a = document.createElement("a");
            document.body.appendChild(a);
            a.setAttribute("style", "display:none");
            a.href = url;
            a.download = result.filename + ".jpg";
            a.click();
            window.URL.revokeObjectURL(url);
            a.remove();
          });
        });
      });
    });
  }

因此,在console.log(sub.base64Image)中,它返回59个图像,但只下载10个。我怎样才能下载所有这些文件?

你能给我们看一下数据吗?你能在stackblitz.com上重现这个例子吗?我不能上传数据。但我可以创建一个示例,如果您查看浏览器调试器工具的“网络”选项卡,它是否发出59个请求?是否所有请求都返回状态200?@H.Hakvoort是的。我刚刚查看了“请求”选项卡!但是下载文件只需要15分钟。从59个请求返回200个OK状态