标签:
public function init(){ $this->enableCsrfValidation = false; }
<input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
var csrfToken = $(‘meta[name="csrf-token"]‘).attr("content"); $.ajax({ type: ‘POST‘, url: url, data: {_csrf:csrfToken}, success: success, dataType: dataType });
标签:
原文地址:http://www.cnblogs.com/chunguang/p/5884552.html