0

我正在调用服务后端,但它执行了 2 或 3 次调用,我不知道为什么,下面我分享我的屏幕和代码。

这是我的服务代码。

public getClaimDataParam  (data:string) {
      let data1={
        "userid": this.userId,
        "status": data
      }
    return this.http.post(this.Api_urls[this.localStorage.get('app_mode')+''].newclaimUrl,data1).map((resp)=>{
    return resp;
        },(error)=>{
     this.spinner.hide()
     alert("Network Error")
   });
    }

这是我的 component.ts 代码

  getClaimList (data) {
      this.loading = true;
      this.spinnerService.show()
        this.batchService.getClaimDataParam(data).subscribe((resp)=>{

            this.spinnerService.hide()
            this.claimsData = resp;



            this.loading = false;

           this.tempClaimData = this.claimsData;

这是我的控制台屏幕截图(请参阅getallclaims

在此处输入图像描述

4

0 回答 0