yunzhiclub / ng

angular开源库
2 stars 0 forks source link

尚未实现对文件下载的模拟发送。 #12

Closed teacherpan closed 3 years ago

teacherpan commented 3 years ago

应该在数据转发时,对类型为Blob的类型转发判断发生了错误。 complete()生效了,但next()时订阅者未接收到数据。

teacherpan commented 3 years ago

示例代码:

    } else if (result instanceof Blob) {
      console.log(result);
      return new Observable<Blob>(subscriber => {
        subscriber.next(result as unknown as Blob);  ➊
        subscriber.complete();
      });
    } else {

执行完➊后,即不发生错误,也接收不到数据。 但如果直接在方法中定义一个Observable<Blob>,然后再观察却可以得到数据 。。。暂时放这了。