NextJs, want to create axiosInstance with dynamic base url

后端 未结 0 1161
难免孤独
难免孤独 2021-02-12 13:33

axios code(Working fine without next js)

let baseURL = \'http://\' + window.location.host.split(\':\')[0] + \':8001/api/\';

axios.defaults.withCredentials = true         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题