前端使用jQuery发起ajax请求向后端请求数据

setup() {
    $.ajax({
      url: "http://localhost:3000/user/acount/token/",
      type: "post",
      data: {
        username: "yxc",
        password: "pyxc",
      },
      success(resp) {
        console.log(resp);
      },
      error(resp) {
        console.log(resp);
      }
    });
  }
posted @ 2024-02-28 21:33  r涤生  阅读(21)  评论(0编辑  收藏  举报