Catch Axios error number

0

I am making a request, which returns me the error 401, however I can not get that number

axios.post(config.urlBase+'adicionar_empresa',formData).then(res=>{if(res.data){this.refs.sucesso.openSucesso(2000);this.refs.load.closeLoad();this.limparCampos();}else{this.refs.erro.openErro(3000);this.refs.load.closeLoad();}}).catch(e=>{console.log(e)});

WhenIrunthecodeup,theconsoledisplaysthis:

I believed that in catch it would bring this information, but it does not, does anyone know how to do it? I got a good researched and nothing worked for me.

Thank you!

    
asked by anonymous 12.06.2018 / 21:51

1 answer

0

I was able to solve the problem, what I had to do was add this line in my .htaccess to enable cors:

Header set Access-Control-Allow-Origin "*"
    
13.06.2018 / 15:03