axios.post请求模板

  1. axios.post请求模板
const result = axios.post(
    `http://127.0.0.1:8080/Home/getData`,
    {
      "id": id,
      "pageindex": page,
      "pagesize": pageSize
    },
    {
      headers: {
        "Accept": "application/json",
      }
    }
  ).then((res) => {
    console.log(res.data)
    return res.data;
  }).catch((error) => {
    console.log(error);
  });
posted @ 2021-11-02 00:01  Freakzzz  阅读(107)  评论(0编辑  收藏  举报