1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\inter\controller;
- use app\admin\library\Auth;
- use app\admin\model\Admin;
- use think\Controller;
- use think\Db;
- use think\Session;
- use think\Config;
- use think\Cookie;
- use think\Cache;
- use think\Log;
- use think\Request;
- class Base extends Controller
- {
- protected $logined = false; //登录状态
- /**
- * 无需登录的方法,同时也就不需要鉴权了
- * @var array
- */
- protected $noNeedLogin = [];
- public $sessionid;
- /**
- * 初始化操作
- */
- public function _initialize()
- {
- $sessionid = Request::instance()->param('sessionid');
- log::record($sessionid);
- log::record('-----------base 页面cache-------------');
- log::record($sessionid);
- log::record('------------------------');
- $admin = Cache::get($sessionid);
- if (!$admin) {
- die(json_encode(['status'=>'fail','code'=>'1010','msg'=>'对不起,您还未进行登录,请先登录']));
- // $this->error('对不起,您还未进行登录,请先登录','inter/index');
- }
- }
- public function _construct()
- {
- $request = Request::instance();
- if($request->method() == 'OPTIONS'){
- return;
- }
- }
- }
|