mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 完善接口请求中间件
This commit is contained in:
parent
c2c1c3da27
commit
5705604a17
application
@ -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);
|
||||||
|
|
||||||
|
11
application/http/middleware/RequestFilter.php
Normal file
11
application/http/middleware/RequestFilter.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\http\middleware;
|
||||||
|
|
||||||
|
class RequestFilter
|
||||||
|
{
|
||||||
|
public function handle($request, \Closure $next)
|
||||||
|
{
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user