vue-core-image-upload icon indicating copy to clipboard operation
vue-core-image-upload copied to clipboard

CORS header issue

Open martijnhiemstra opened this issue 7 years ago • 3 comments

When I upload an image I get this error:

The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

The rest of my website works perfectly. I can confirm that the images is uploaded however it seams as if there is somtheing going wrong with the response.

My html is this:

  <vue-core-image-upload
          class="btn btn-primary"
          :crop="true"
          @imageuploaded="imageuploaded"
          :data="company.logo"
          :max-file-size="5242880"
          crop="local"
          :url="getCompanyImageUrl()">
  </vue-core-image-upload>

And the reponse is a json message containing a boolean if the image could be saved.

martijnhiemstra avatar Aug 05 '17 19:08 martijnhiemstra

I also met the same problem, how to solve

zhyn avatar Aug 09 '17 04:08 zhyn

You could solve this issue via those methods:

  • Change your local hosts. (localhost you_api_domain.com )
  • Your server side engineer write the header to limit the domain access.

JackPu avatar Aug 10 '17 06:08 JackPu

@JackPu 大佬,第一种解决方式,是更改自己的IP地址还是说其他地方?请问有具体解决步骤吗?

OBKoro1 avatar Aug 16 '17 12:08 OBKoro1