get post 更改不了的问题

今天更改访问方式,get post 出现了以下问题

以下代码把method:"get"  更改为 method:"post"没有用

getDataList(dd) {
      //debugger;;
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl(
          "/generator/kdtask/queryFZOrdersE/" + this.taskUseSum
        ),
        method: "get",
        params: this.$http.adornParams({
          page: this.pageIndex,
          limit: this.pageSize,
          rt_results: this.dataForm.key,
        }),
      }).then(({ data }) => {
        if (data && data.code === 0) {
          this.dataList = data.orderList;
          this.backDataList= data.orderList;

          if (this.dataList) {
            this.orderArray = [];
            this.taskIdsArray=[];
            this.dataList.forEach((order) => {
              this.orderArray.push(JSON.parse(order.rt_order));
              this.taskIdsArray.push(order.id);
            });
          }

          //this.totalPage = data.page.totalCount;
        } else {
          this.dataList = [];
          this.backDataList= [];
          this.totalPage = 0;
        }
        this.dataListLoading = false;
      });
    },

  post 要用以下方式

  getSameDataList_post() {
      //debugger;;
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl(
          "/generator/kdtask/queryAllByIds"
        ),      
        method: "post",
        data: this.$http.adornData(this.taskIdsArray, false)
        // params: this.$http.adornParams({
        //   // ids: this.taskIdsArray,
        //   data: this.$http.adornData(this.taskIdsArray, false)
        // }),
      }).then(({ data }) => {
        if (data && data.code === 0) {
          this.dataList = data.List;         
        } else {
          this.totalPage = 0;
        }
        this.dataListLoading = false;
      });
    },

  

posted @ 2020-11-10 16:45  天之泉  阅读(361)  评论(0编辑  收藏  举报