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'); } } function getRandomString($len, $chars=null) { if (is_null($chars)){ $chars = "abcdefghijklmnopqrstuvwxyz0123456789"; } mt_srand(10000000*(double)microtime()); for ($i = 0, $str = '', $lc = strlen($chars)-1; $i < $len; $i++){ $str .= $chars[mt_rand(0, $lc)]; } return $str; } public function _construct() { $request = Request::instance(); if($request->method() == 'OPTIONS'){ return; } } }