header(); if(!isset($header['authkey'])){ header('Content-Type:application/json; charset=utf-8'); exit(json_encode(['code'=>103, 'error'=>'非法操作'],JSON_UNESCAPED_UNICODE)); } $authKey = $header['authkey']; $cache = cache('Auth_'.$authKey); if(empty($authKey) || empty($cache)){ header('Content-Type:application/json; charset=utf-8'); exit(json_encode(['code'=>103, 'error'=>'登录已失效'],JSON_UNESCAPED_UNICODE)); } cache('Auth_'.$authKey, $cache, 7200); } }