Answer the question
In order to leave comments, you need to log in
How to get data from server via axios?
Good day, I have the following code,
mounted() {
axios
.get("http://anton77777.beget.tech/")
.then(response => {
if(response.data.error) {
console.log(response.data.message)
} else {
// this.users = response.data.users
console.log(response.data)
}
})
},
Access to XMLHttpRequest at 'https://localhost:9002/admin/dist/companies' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
createError.js?2d83:16 Uncaught (in promise) Error: Network Error
at createError (createError.js?2d83:16)
at XMLHttpRequest.handleError (xhr.js?b50d:81)
'Access-Control-Allow-Origin: *');
header(
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question