我使用Yii2,并且需要连接ckedit5,但是上传照片时出现错误-400错误请求

问题描述

$(“。editor”)。each(function(){ 让id = $(this).attr('id'); 经典编辑器 .create(document.querySelector('#'+ id),{

            toolbar: [ 'heading','|','bold','italic','link','bulletedList','numberedList','blockQuote','imageUpload' ],ckfinder: {
            // Upload the images to the server using the CKFinder QuickUpload command.
             headers: {
               tokenUrl: '{$csrf_token}'
            },uploadUrl: '/admin/settings/ajax-upload-photo',},heading: {
                options: [
                    { model: 'paragraph',title: 'Paragraph',class: 'ck-heading_paragraph' },{ model: 'heading1',view: 'h1',title: 'Heading 1',class: 'ck-heading_heading1' },{ model: 'heading2',view: 'h2',title: 'Heading 2',class: 'ck-heading_heading2' }
                ]
            },})
        .then(function (editor) {
            console.log(editor);
        })
        .catch(function (error) {
            console.error(error);
        });
});

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)