✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Folgende Axios Konfiguration ist vorgesehen:
import axios from "axios";
import authHeader from "@/services/AuthHeader";
const instance = axios.create({
headers: {
'Content-type': 'application/json' },
timeout: 60000,
baseURL: "
https://venlab.backend.at/api"
});
instance.interceptors.request.use(
config => {
const headers = authHeader();
if (headers) {
config.headers = { ...config.headers, ...headers };
}
return config;
},
error => {
return Promise.reject(error);
}
)
export default instance
Ist diese funktionstüchtig?