Access-Control-Allow-Origin (Laravel & Vue) CORS CORB error on localhost

前端 未结 2 951
有刺的猬
有刺的猬 2021-01-16 13:28

I use this package and it didn\'t work (https://github.com/barryvdh/laravel-cors)

addSMS() {
    axios.post(\'https://smsmisr.com/api/webapi\', {
           


        
2条回答
  •  情歌与酒
    2021-01-16 14:10

    Update config/cors.php

       'supportsCredentials' => false,
       'allowedOrigins' => ['*'],
       'allowedHeaders' => ['*'],
       'allowedMethods' => ['*'], // ex: ['GET', 'POST', 'PUT',  'DELETE']
       'exposedHeaders' => ['*'],
       'maxAge' => 0,
    
       then run
       php artisan config:cache 
       command i think it will help you
    

提交回复
热议问题