From 3fac51bbeed3a7775d94fd85ff5af417d052ced8 Mon Sep 17 00:00:00 2001 From: Yang Li <312166131@qq.com> Date: Mon, 31 Jul 2017 17:09:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BFpost=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复post接口在线调试不通过的bug --- tpl/api_desc_tpl.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tpl/api_desc_tpl.php b/tpl/api_desc_tpl.php index 7133754..a12b096 100644 --- a/tpl/api_desc_tpl.php +++ b/tpl/api_desc_tpl.php @@ -189,6 +189,7 @@ /** * 底部 */ +$_csrf = \Yii::$app->request->getCsrfToken(); echo << 温馨提示: 此接口参数列表根据后台代码自动生成,可将 ?r= 改成您需要查询的接口/服务 @@ -204,6 +205,9 @@ function getData() { data[e.name] = e.value; } }); + if ($("select").val() == 'POST') { + data['_csrf'] = "$_csrf"; + } return data; }