zoukankan      html  css  js  c++  java
  • ucenter 和 uchome的整合心得

    简介:这是ucenter 和 uchome的整合心得的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。

    class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=343928' scrolling='no'>

    1.每一个应用都包含uc_client,拿uchome举例

    2.uchome登陆时访问source/do_login.php 的getpassport函数,getpassport通过uc_client 直接连ucenter的数据库,实现当前站点的登陆

    3.uchome然后调用$ucsynlogin = uc_user_synlogin($setarr['uid']);实现跨域登陆

    4.在uc_user_synlogin函数里再用uc_client/client.php的fsockopen去访问ucenter下的index.php默认超时15秒

    5.在ucenter下的index.php根据请求的model和action和appid请求control/user.php 的onsynlogin函数

    6.onsynlogin函数通过循环,对系统下的所有应用(在data/cache/setting.php)做JS调用如下
    $synstr .= '<script type="text/javascript" src="'.$app['url'].'/api/uc.php?time='.$this->time.'&code='.urlencode($this->authcode('action=synlogin&username='.$this->user['username'].'&uid='.$this->user['uid'].'&password='.$this->user['password']." mce_src="'.$app['url'].'/api/uc.php?time='.$this->time.'&code='.urlencode($this->authcode('action=synlogin&username='.$this->user['username'].'&uid='.$this->user['uid'].'&password='.$this->user['password']."&time=".$this->time, 'ENCODE', $app['authkey'])).'"></script>';

    7.返回到uchome.在每个应用下的api目录有个uc.php文件查找$action == 'synlogin'下面是进行cookie设置
    obclean();
    header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
    这两行是必须的

    8.这样就在所有ucenter知道的应用下添加了cookie实现了跨域登陆

    爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

    http://biancheng.dnbcw.info/php/343928.html pageNo:5
  • 相关阅读:
    Kafka的安装和设置
    Nginx的安装和设置
    Spark实现K-Means算法
    Spark GraphX实例(2)
    Scala字符串插值
    Scala的Class、Object和Apply()方法
    Spark GraphX实例(1)
    java.lang.ClassNotFoundException: SparkPi$$anonfun$1
    Intellij IDEA连接Spark集群
    Container [pid=6263,containerID=container_1494900155967_0001_02_000001] is running beyond virtual memory limits
  • 原文地址:https://www.cnblogs.com/ooooo/p/2241962.html
Copyright © 2011-2022 走看看