Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 ngFlow 将文件上传到 laravel。CSRF 令牌通过 ajax 发送:
<script>angular.module("app").constant("CSRF_TOKEN", '[[ csrf_token() ]]');</script>
<script>angular.module("app").constant("CSRF_TOKEN", '[[ csrf_token() ]]');</script
并通过服务注入控制器。
我如何将令牌附加到请求中?
问题很老了,您可以尝试通过flow-init传递它。
flow-init="{headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}}"
希望它可以帮助某人!