1
0
mirror of https://gitee.com/apiadmin/ApiAdmin.git synced 2025-04-06 03:58:00 +08:00

modified 完善接口请求中间件

This commit is contained in:
zhaoxiang 2019-06-30 15:46:45 +08:00
parent c2c1c3da27
commit 5705604a17
2 changed files with 12 additions and 1 deletions
application
admin/controller
http/middleware

@ -185,7 +185,7 @@ class InterfaceList extends Base {
$listInfo = AdminList::all(['status' => 1]); $listInfo = AdminList::all(['status' => 1]);
$tplStr = ''; $tplStr = '';
foreach ($listInfo as $value) { foreach ($listInfo as $value) {
$tplStr .= 'Route::rule(\'' . addslashes($value->hash) . '\',\'api/' . addslashes($value->api_class) . '\', \'' . $methodArr[$value->method] . '\')->middleware([\'ApiAuth\', \'ApiPermission\', \'ApiLog\']);'; $tplStr .= 'Route::rule(\'' . addslashes($value->hash) . '\',\'api/' . addslashes($value->api_class) . '\', \'' . $methodArr[$value->method] . '\')->middleware([\'ApiAuth\', \'ApiPermission\', \'RequestFilter\', \'ApiLog\']);';
} }
$tplOriginStr = str_replace(['{$API_RULE}'], [$tplStr], $tplOriginStr); $tplOriginStr = str_replace(['{$API_RULE}'], [$tplStr], $tplOriginStr);

@ -0,0 +1,11 @@
<?php
namespace app\http\middleware;
class RequestFilter
{
public function handle($request, \Closure $next)
{
return $next($request);
}
}