1. jq-ajax

  1. var url = "http://localhost:3000/search"
  2. $.ajax({
  3. url,
  4. type:"get",
  5. data:{
  6. keywords:"你"
  7. },
  8. success:res=>{
  9. console.log(res);
  10. }
  11. })

axios

  1. var url = "/search"
  2. axios({
  3. url,
  4. baseURL:"http://localhost:3000",
  5. method:"get",
  6. params:{
  7. keywords:"你"
  8. }
  9. }).then(res=>{
  10. console.log(res);
  11. })