Base.php 702 B

12345678910111213141516171819202122
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. class Base extends Controller{
  5. const redis_host = 'lredis';
  6. const redis_port = 6379;
  7. const queue_name = 'net_access_queue';
  8. private $no_check = ['order/checkorder' , 'order/recordstore' , 'order/checkfcode' , 'order/recordfetch'];
  9. public function initialize(){
  10. $control = lcfirst(request()->controller());
  11. $action = lcfirst(request()->action());
  12. if(!in_array($control . '/' . $action , $this->no_check)){
  13. if(empty(session('username')) || empty(session('id'))){
  14. //登录超时
  15. json(json_error_exception('1005'))->send();
  16. }
  17. }
  18. }
  19. }