1、适用于 ajax和普通的http请求

2、vue添加用法如下:

<script type="text/javascript src="/dist/js/app.min.js">
<script type="text/javascript>
Vue.http.interceptors.push(function(request, next) {

            // modify headers
            request.headers.set('X-CSRF-TOKEN', '{{ csrf_token() }}');

            // continue to next interceptor
            next();
        });
</script>

 

相关文章:

  • 2021-07-09
  • 2021-07-16
  • 2021-12-29
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2021-08-10
相关资源
相似解决方案