企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` public function _initialize() { $cktoken=$this->request->param(); if(!isset($cktoken['token']) || !isset($cktoken['phone']) ){ echo json_encode(['code'=>400,'message'=>'传参错误,token跟phone必传']);die(); } $redis=new Redis(); $ctoken=$redis->has('token'.$cktoken['phone']); if($ctoken){ $token=$redis->get('token'.$cktoken['phone']); if($token!=$cktoken['token']){ echo json_encode(['code'=>400,'message'=>'token不一致,请重新登录']);die(); } }else{ echo json_encode(['code'=>400,'message'=>'token失效,请重新登录']);die(); } } ```