// +---------------------------------------------------------------------- namespace app\http\middleware; use think\facade\Session; /** * @title 后台中间件 */ class Admin { public function handle($request, \Closure $next) { $user = Session::get('user'); $request->url = str_replace(".", "/", strtolower($request->controller())) . '/' . $request->action(); $request->pageConfig = array( 'list_rows' => $request->param('limit', 20), 'page' => $request->param('page', 1), 'query' => $request->param() ); $response = $next($request); return $response; } }