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

View File

@ -185,7 +185,7 @@ class InterfaceList extends Base {
$listInfo = AdminList::all(['status' => 1]);
$tplStr = '';
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);

View File

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