Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

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

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

图片描述

图片描述

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

对应控制器加public $enableCsrfValidation = false;或者init()的时候禁用试试,如果可以就是你CSRF的token隐藏域加的时候写错了。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...