报错信息:Uncaught (in promise) DOMException: Failed to execute 'open' on 'XMLHttpRequest': Invalid URL

 

解决方案:baseUrl前面一定要加http://

 

let axios =Axios.create({
  withCredentials:true, //跨域过程中,客户端必须要设置,允许ajax 携带cookie到服务器;
  baseURL:'http://127.0.0.1:3006/api/'

});

 

 Request URL:

Axios 使用采坑经验

Axios 使用采坑经验

 

相关文章:

  • 2021-11-10
  • 2022-12-23
  • 2021-09-28
  • 2021-10-02
  • 2022-12-23
  • 2022-02-16
  • 2021-05-27
  • 2021-05-30
猜你喜欢
  • 2022-12-23
  • 2021-12-14
  • 2021-04-09
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
相关资源
相似解决方案