0
I created a component that exports Axios:
import axios from "axios";
const token = 'Z31XC52XC4';
export default axios.create({
baseURL: 'https://xxxxx.xxxxx.com.br/api/',
headers: {
'Accept': 'application/json, text/plain, */*',
'Access-Origin': 'D',
'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIzMDEyOSwiaXNzIjoiaHR0cDovL3dlYi1zZXJ2aWNlcy55ZWFwcHMuY29tLmJyL2FwaS91c2Vycy9sb2dpbiIsImlhdCI6MTU1ODU0OTIxMCwiZXhwIjoxNTU5NzU4ODEwLCJuYmYiOjE1NTg1NDkyMTAsImp0aSI6ImxOeDlJNmpWWnFWU1NaeVIifQ.WfayLZMLfGRUwoH2LfBhDWgX4soiISrGxr7lZDZOYUA',
'Company-Token': token
}
});
On the other side I need to pick up this constant called token:
import api from '../src/components/Util/api.js';
const token = api.token; ?????
Could someone tell me how to do this?