Base.php 358 B

123456789101112131415161718
  1. <?php
  2. namespace app\admin\controller;
  3. use think\Controller;
  4. class Base extends Controller
  5. {
  6. public function _initialize()
  7. {
  8. if (!session('user_id')) {
  9. $this->redirect('admin/login/index');
  10. }
  11. $this->assign([
  12. 'version' => config('version'),
  13. 'socket' =>config('socket'),
  14. ]);
  15. }
  16. }