LoginController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Released under the MIT License.
  8. // +----------------------------------------------------------------------
  9. // | Author: 老猫 <thinkcmf@126.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\index\controller;
  12. use app\index\service\PRedis;
  13. use cmf\controller\HomeBaseController;
  14. class LoginController extends HomeBaseController
  15. {
  16. public function index()
  17. {
  18. return $this->fetch();
  19. }
  20. /**
  21. * 退出登录
  22. */
  23. public function logout(){
  24. $cacheKey = md5(session('UID').'qxq');
  25. PRedis::del($cacheKey);
  26. session('UID', 0);
  27. $this->redirect(url('/index/login/index'));
  28. }
  29. public function test(){
  30. return $this->fetch();
  31. }
  32. }