12345678910111213141516171819202122 |
- <?php
- namespace app\index\controller;
- use think\Controller;
- class Base extends Controller{
- const redis_host = 'lredis';
- const redis_port = 6379;
- const queue_name = 'net_access_queue';
- private $no_check = ['order/checkorder' , 'order/recordstore' , 'order/checkfcode' , 'order/recordfetch' , 'cabinet/getcabinetsboxs' , 'cabinet/boxchangestatus'];
- public function initialize(){
- $control = lcfirst(request()->controller());
- $action = lcfirst(request()->action());
- if(!in_array($control . '/' . $action , $this->no_check)){
- if(empty(session('username')) || empty(session('id'))){
- //登录超时
- json(json_error_exception('1005'))->send();
- }
- }
- }
- }
|