Error:
創(chuàng)新互聯(lián)專注于永康網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供永康營銷型網(wǎng)站建設(shè),永康網(wǎng)站制作、永康網(wǎng)頁設(shè)計(jì)、永康網(wǎng)站官網(wǎng)定制、成都小程序開發(fā)服務(wù),打造永康網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供永康網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。
前端訪問后端時(shí)出現(xiàn)如下報(bào)錯(cuò):
Access to XMLHttpRequest at 'http://localhost:8000/api/slideshow' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
解決:
安裝 CORS Middleware for Laravel. (fruitcake /laravel-cors)
The laravel-cors package allows you to send Cross-Origin Resource Sharing headers with Laravel middleware configuration.
https://github.com/fruitcake/laravel-cors