【问题标题】:LTI integration with LaravelLTI 与 Laravel 的集成
【发布时间】:2019-01-08 15:31:55
【问题描述】:

我正在尝试使用LTI specification,因此我在 Moodle 上注册了一个指向我的 Laravel 应用程序的启动 URL。但我收到 419 状态错误。

我的 web.php:

Route::post('/lti', 'PagesController@lti');

我的启动网址:

localhost/projectlaravel/public/lti

有人可以帮忙吗?

【问题讨论】:

    标签: php laravel lti


    【解决方案1】:

    在你的刀片文件的头部使用这个:

    <meta name="csrf-token" content="{{ csrf_token() }}">
    

    并在 ajax 中获取 csrf 令牌:

    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    

    请参考 Laravel 文档csrf_token

    【讨论】:

      猜你喜欢
      • 2016-08-22
      • 1970-01-01
      • 2020-10-19
      • 2022-12-21
      • 2016-01-06
      • 2016-12-26
      • 1970-01-01
      • 2020-12-27
      • 1970-01-01
      相关资源
      最近更新 更多