ucenter 项目配置https后ucenter提示通信失败
项目配置好了https ,同时也配置了 301 重定向从http跳转https ,会导致ucenter通信失败,解决办法如下将下面代码 添加到:uc_server/model/misc.php 位置 69 行/*=========================================================== */
if(substr($url,0,5)=='https'){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if($post){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
if($cookie){
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
return curl_exec($ch);
/*=========================================================================================== */
完成后如图所示:
https://img-blog.csdn.net/20171218160020156?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmVucGFvZGVsdWx1X2d1YWppYW4=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast
页:
[1]