how to return response of axios in return

前端 未结 4 1865
长情又很酷
长情又很酷 2021-02-01 06:09

I want to return the response of axios but always the response that returned is undefined:

wallet.registerUser=function(data){
axios.post(\'http://localhost:8080         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 06:45

    I used async and await methods and wrapped my axios call and function calling the axios call in these methods. I returned axios value as well as returned response object within it. I have shared the snippet in the below link.

    Returning data from Axios API

提交回复
热议问题