Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
在线post接口调试
Browse files Browse the repository at this point in the history
修复post接口在线调试不通过的bug
  • Loading branch information
coder-liyang authored Jul 31, 2017
1 parent 9e95329 commit 3fac51b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tpl/api_desc_tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
/**
* 底部
*/
$_csrf = \Yii::$app->request->getCsrfToken();
echo <<<EOT
<div class="ui blue message">
<strong>温馨提示:</strong> 此接口参数列表根据后台代码自动生成,可将 ?r= 改成您需要查询的接口/服务
Expand All @@ -204,6 +205,9 @@ function getData() {
data[e.name] = e.value;
}
});
if ($("select").val() == 'POST') {
data['_csrf'] = "$_csrf";
}
return data;
}
Expand Down

0 comments on commit 3fac51b

Please sign in to comment.