AdminLog.php 989 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare (strict_types = 1);
  3. // +----------------------------------------------------------------------
  4. // |
  5. // +----------------------------------------------------------------------
  6. // |
  7. // +----------------------------------------------------------------------
  8. // |
  9. // +----------------------------------------------------------------------
  10. // |
  11. // +----------------------------------------------------------------------
  12. // +----------------------------------------------------------------------
  13. // | 写入管理日志
  14. // +----------------------------------------------------------------------
  15. namespace app\admin\middleware;
  16. use app\admin\model\Adminlog as AdminlogModel;
  17. use think\facade\Config;
  18. class AdminLog
  19. {
  20. public function handle($request, \Closure $next)
  21. {
  22. $response = $next($request);
  23. if (($request->isPost()) && Config::get('yzn.admin_auto_record_log')) {
  24. AdminLogModel::record();
  25. }
  26. return $response;
  27. }
  28. }