34 lines
1.1 KiB
PHP
Executable File
34 lines
1.1 KiB
PHP
Executable File
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
|
// +----------------------------------------------------------------------
|
|
namespace app\http\middleware;
|
|
|
|
use app\model\MemberLog;
|
|
use think\facade\Session;
|
|
|
|
/**
|
|
* @title 后台中间件
|
|
*/
|
|
class Admin {
|
|
|
|
public function handle($request, \Closure $next) {
|
|
$request->rootUid = env('rootuid');
|
|
$request->user = Session::get('adminInfo');
|
|
$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(),
|
|
);
|
|
MemberLog::record($request);
|
|
|
|
$response = $next($request);
|
|
return $response;
|
|
}
|
|
} |