当前位置: 首页> 财经> 创投人物 > 建一个网页需要多少钱_crm资源管理系统_seo优化软件大全_哈尔滨关键词优化报价

建一个网页需要多少钱_crm资源管理系统_seo优化软件大全_哈尔滨关键词优化报价

时间:2025/7/14 21:10:52来源:https://blog.csdn.net/qq_39835505/article/details/142553288 浏览次数:0次
建一个网页需要多少钱_crm资源管理系统_seo优化软件大全_哈尔滨关键词优化报价

参考文章
https://blog.51cto.com/17099933344/1935194
https://blog.csdn.net/m0_37346206/article/details/127333463
https://www.cnblogs.com/tk-bolg/p/18108106

使用的企微接口
https://qyapi.weixin.qq.com/cgi-bin/message/send
在这里插入图片描述

查询 ssl证书到期时间

 // ssl证书即将到期提醒
public function ssl_ts(){$domain_all = ['www.ylhdad.com',];$tz = false;foreach ($domain_all as $v){$cert_info = $this->get_cert_info($v);$validTo_time_t = $cert_info['validTo_time_t'];$validTo_time_d = date('Y-m-d H:i:s', $validTo_time_t);   // 过期时间// 计算剩余天数$xc_time = intval( ( $validTo_time_t - time() ) / (60*60*24)  );// if($xc_time > 80){if($xc_time <= 3){$tz=true;break;}}// if($xc_time <= 3){if($tz){// 替换为你的证书文件路径// $certificatePath = '/www/server/panel/vhost/cert/ylhdad.com/privkey.pem';$data = ["touser"=> "ZhuoZhuoTaoHuaYao|123",// "touser"=> "ZhuoZhuoTaoHuaYao","msgtype"=> "text","agentid"=> 1000002,"text"=> ["content"=> "ssl证书即将过期,请及时更新。"// "content"=> "你的快递已到,请携带工卡前往邮件中心领取。\n出发前可查看<a href=\"http://work.weixin.qq.com\">邮件中心视频实况</a>,聪明避开排队。"],"safe"=> 0,"enable_id_trans"=> 0,"enable_duplicate_check"=> 0,"duplicate_check_interval"=> 1800];$qwechat = new Qwechat('ww1', 'k1BuIwtk7p2pdem');$token = $qwechat->getAccessToken();$api = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=".$token;   // 正式域名$response = $this->post($api, json_encode($data)); Log::info('ssl证书过期,提醒成功'  . json_encode($response) );// var_dump('请求返回');// var_dump($response);}Log::info('没有即将ssl证书过期,执行成功' );}// 得到ssl证书信息
public function get_cert_info($domain){$context = stream_context_create(['ssl' => ['capture_peer_cert' => true,'capture_peer_cert_chain' => true,],]);$client = stream_socket_client("ssl://".$domain.":443", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);if($client==false) {return false;}$params = stream_context_get_params($client);$cert = $params['options']['ssl']['peer_certificate'];$cert_info = openssl_x509_parse($cert);return $cert_info;
}//请求
public function post($url, $data) {$headers = [// "Authorization: " . $authorization,"Accept: application/json","Content-Type:application/json",];$ch = curl_init();curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);//设置HTTP头curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);$res = curl_exec($ch);//         $error = curl_error($ch); // var_dump($error);exit(0);curl_close($ch);return json_decode($res, true);
}
关键字:建一个网页需要多少钱_crm资源管理系统_seo优化软件大全_哈尔滨关键词优化报价

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: