vue的get和post请求

164 阅读1分钟

get

 axios
    .get("report/accountReport/queryall", {
      params: {
        page: this.currentPage,
      },
    })
    .then((res) => {
      this.loading = false;
  
    })
    .catch((err) => {
      // 请求失败处理
      Notification.error({
        title: err.message,
        duration: 5000,
      });
    });
    

post

   axios
        .post("report/accountReport/queryall", {
            page: this.currentPage,
        })
        .then((res) => {
          this.loading = false;
        })
        .catch((err) => {
          // 请求失败处理
          Notification.error({
            title: err.message,
            duration: 5000,
          });
        });