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?

1 Answer 1

0

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

How do I set up CORS?

2
  • How to doing ? Drupal 8 restrict the Cors module .Or you can recommend the CORS module for me.thanks. Commented Jun 11, 2019 at 9:27
  • read the link aka drupal.stackexchange.com/questions/245903/how-do-i-set-up-cors above then edit your "sites/default/default.services.yml" file ! Commented Jun 12, 2019 at 12:35

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.