A
A
Artem Nanavov2019-12-26 08:15:43
Vue.js
Artem Nanavov, 2019-12-26 08:15:43

Has been blocked by CORS policy: The 'Access-Control-Allow-Origin'?

5e04417a0a9ac397346942.jpeg
there is an error but I don’t know how to fix it (I’m studying axios for 1 day)
I want to add data to the array,
here is the code

import axios from 'axios'

    export default {

        data() {
            return {
                results: []
            }
        },
        mounted() {
            axios.get('http://gallery.dev.webant.ru/api/photos?page=1').then( response => {
                this.results = response.data
            } )
        },
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Kondratsky, 2019-12-26
@kondrackii

Read about CORS . For now, the solution to the problem is to use jsonp .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question