1 public function getdata() 2 $method = 'DES-ECB';//加密方法 3 $passwd = 'qq496631085';//加密密钥 4 $options = 0;//数据格式选项(可选) 5 $iv = '';//加密初始化向量(可选) 6 $url = base64_decode('aHR0cDovL2FkbWluLmhlNDk2Ni5jbi9pbmRleC5waHAvYXBpL2hlL2dldGRhdGEvdXJsLw==').base64_encode(Request::domain()); 7 // halt($url); 8 $result = file_get_contents($url); 9 $jiemi2 = (openssl_decrypt($result, $method, $passwd, 0)); 10 $jiemi1 = substr($jiemi2,3,strlen($jiemi2)-7-3); 11 $data = json_decode(base64_decode($jiemi1)); 12 $date = $data->date; 13 if(strtotime($date)<time()+50){ 14 echo $data->msg; 15 exit(); 16 }