Failed to load http://xxx.xxx.x: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.
<code>createError.js:16 Uncaught (in promise) Error: Network Error
at createError (createError.js:16)
at XMLHttpRequest.handleError (xhr.js:87)
</code>
Вот запрос
<code><template>
<div>
</div>
</template>
<script>
import axios from 'axios'
export default {
methods: {
test() {
axios.post("http://xxx.xx.xx",{ headers: { 'Access-Control-Allow-Origin': true }} )
.then((res) => {
console.log(res);
return {res}
})
}
},
mounted() {
return this.test()
}
}</code>