doudan1123 2017-10-22 10:00
浏览 365

从axios发布到laravel时出现419错误

i'm tired for more than week i can't resolve this, i have the csrf which it's already attached to the axios header at bootstap.js, i get always this response from server when try to post simple post ( they are three pictures below explaining my situation ) thanks for the advance axios post from vue file

Route at web.php

result 1

result 2

  • 写回答

1条回答 默认 最新

  • duangou2046 2017-12-04 09:25
    关注

    Try this, it works for me so far but you'll be without CSRF, go to 'App\Http\Middleware\VerifyCsrfToken' then edit the protected variable to this

     protected $except = [
         "/*"
     ];
    

    the '/*' says to exclude CSRF from all routes, although this isn't ideal it should fix the problem, Maybe just exclude those specific routes that are throwing you the error?

    e.g. "/specificRoute"

    评论

报告相同问题?

悬赏问题

  • ¥15 vscode问题请教
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM