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