Angular 请求和从服务器获取响应中的冲突

问题描述

我有一个 Angular 应用程序,我试图同时从我的 API 获取 4 个请求,但有时所有请求都会得到相同的结果。 我尝试了很多东西并在没有蚂蚁解决方案的情况下检查每个端点 你能帮忙解决这个问题吗? 提前致谢。 这是我描述问题的代码

enter image description here

     loadData(){
    this.servPrtner.GET(EndPointsURL.Partner).subscribe(
      (prtnr: ResponseDTO) => {
        if(prtnr.isPassed === true)
        {
          Swal.fire({
            title: 'Checking...',text: prtnr.message,showConfirmButton: false,allowOutsideClick: false,didOpen: () => {
              Swal.showLoading();
            },});
          this.partners = prtnr.data['list'];
          console.log(prtnr);
          Swal.close();
        }
        else
        Swal.fire({
          title: 'error',didOpen: () => {
            Swal.showLoading();
          },});
        Swal.close();
        
      },(err) => {
        console.log(err);
      }
    );
  };

loadData() {
    this.servconctent.GET(EndPointsURL.Content).subscribe((content: ResponseDTO) => {
      if (content.isPassed == true) {
        Swal.fire({
          title: 'Checking...',text: content.message,});
        this.AllContent = content.data['list'];
        console.log(content);
        Swal.close();
      } else {
        Swal.fire({
          title: 'Error!',icon: 'error',confirmButtonText: 'Close',});
      }
    },(error) => {
        Swal.fire({
          title: 'Error' + error.status,text: error.statusText,didClose: () => {
            if (error.status === 401) {
              //this.http.setTokenExpiriation(true);
            }
          },});
      }
    );
  };

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...