php - yii2 advanced 集成wangEditor,图片上传报400。
PHP中文网
PHP中文网 2017-05-16 13:09:02
0
2
528

yii2 advanced 集成wangEditor,图片上传报400。

400之前遇到说因为csrf,但隐藏域代码已加
<input type="hidden" id="_csrf" name="_csrf-frontend" value="<?php echo yii::$app->request->csrfToken; ?>" />

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
世界只因有你

Try to disable it when adding public $enableCsrfValidation = false; or init() to the corresponding controller. If it works, it means you wrote the wrong CSRF token hidden field when adding it.

漂亮男人

You can try changing your hidden domain to something like this

<input type="hidden" name="_csrf" value="<?php echo yii::$app->request->csrfToken; ?>" />
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!