Index.php 452 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\admin\controller;
  3. use think\Controller;
  4. use think\Session;
  5. use think\Db;
  6. use think\Request;
  7. class Index extends Controller
  8. {
  9. protected function _initialize()
  10. {
  11. if(!session('?admin')){
  12. $this->redirect('login/index');
  13. }
  14. }
  15. public function index()
  16. {
  17. $session=session('admin');
  18. $this->assign('account', $session['username']);
  19. return $this->fetch();
  20. }
  21. }