0

I got the data with postman in json:api at drupal. enter image description here But I has error of CORB in Vue-resource.get() with code blew:

 data(){
    return{
        cyclePic:[],
        rootUrl:this.$http.options.root,
        header:{headers:{Accept:'application/vnd.api+json',
            'Content-type':'application/vnd.api+json',
            Authorization:"Basic dG1wQWRtaW46VG1wQDEyMyM0NTY="}                
            }                     
    }
},
created(){
    this.getCycleList()
},
methods:{
    getCycleList(){

        this.$http.get('jsonapi/node/banner?include=field_image',this.header).then(result=>{
            console.log(result)

            if(result.ok && result.status===200){
                this.cyclePic=result.body.included
                console.log(this.cyclePic)
            }else{
                Toast('Fail')
            }

        })
    }

what i miss some thing?

0

You need to set up your Cors settings Look at your services.yml file then read ...

How do I set up CORS?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.