AdminLog.php 429 B

12345678910111213141516171819
  1. <?php
  2. namespace app\common\middleware;
  3. use Closure;
  4. use think\facade\Config;
  5. use app\admin\model\AdminLog as AdminLogModel;
  6. class AdminLog
  7. {
  8. public function handle($request, Closure $next)
  9. {
  10. $response = $next($request);
  11. if (($request->isPost() || $request->isDelete()) && Config::get('buildadmin.auto_write_admin_log')) {
  12. AdminLogModel::record();
  13. }
  14. return $response;
  15. }
  16. }