time()+150){ throw new HttpResponseException(_error('请求已过期', 400)); } $timestamp = $post['timestamp']; unset($post['timestamp']); }else{ throw new HttpResponseException(_error('缺少timestamp', 400)); } if (empty($sign)){ throw new HttpResponseException(_error('缺少sign', 400)); } // 获取token $channel = Channel::where('appkey', $appkey)->where('status', 1)->where('is_deleted', 0)->find(); if(!$channel){ throw new HttpResponseException(_error('缺少appkey', 400)); } $str = "appkey={$appkey}×tamp={$timestamp}&token=".$channel['token']; if($sign != md5($str)){ throw new HttpResponseException(_error('签名错误', 400)); } return true; } }