ucenter 通信原理,ucenter
ucenter 通信原理,ucenter
1、用户登录discuz,通过logging.php文件中的函数uc_user_login对post过来的数据进行验证,也就是对username和password进行验证。
2、如果验证成功,将调用位于uc_client下client.php文件中的函数uc_user_synlogin,在这个函数中调用 uc_api_post('user', 'synlogin', array('uid'=>$uid))。
3、然后这个函数后向Ucenter的index.php传递数据,index.php接受传递的数据,获得model为user,action为synlogin的值。
4、然后Ucenter的index.php调用control目录下的user.php类中的onsynlogin方法,通过foreach循环,以javascript的方式通知uc应用列表中开启同步登陆的应用进行同步登录;即通过get方式传递给各个应用目录中api下的uc.php一些数据。
5、uc.php接收通知并处理get过来的数据,并在函数synlogin(位于uc.php中)通过函数_authcode加密数据(默认以UC_KEY作为密钥),用函数_setcookie设置cookie。
6、各个应用用对应的密钥解码上面设置的cookie,得到用户id等数据;通过这个值来判断用户是否经过其它应用登录过,从而让用户可以自动登陆。
应用程序的logging.php ------>uc_client中的client.php------>Ucenter------>其他应用程序中的api/uc.php。
其实Ucenter实现同步登陆的原理就是cookie,一个应用登陆成功之后,向Ucenter传递数据,让Ucenter通知其他的应用也设置cookie,这样用户在访问其他应用的时候通过已经设置好的cookie实现自动登陆。
大致步骤 ,首先要安装 ucenter 然后把uc_client 这个文件夹复制到自己的项目里面去 ,然后呢在配置几个文件
client.php相当于函数库
uc.php相当于回调文件
config.php 是配置文件
当你有2个应用都设置了同步登陆之后 当你登陆一个应用 然后执行
include './config.inc.php';
include './uc_client/client.php';
$usernames="kyee";
$passwords="123456";
list($uid, $username, $password, $email) = uc_user_login($usernames, $passwords);
if($uid > 0) {
setcookie("username",$username,time()+intval(24*3600));
echo uc_user_synlogin($uid);
echo '登录成功';
} elseif($uid == -1) {
echo '用户不存在,或者被删除';
} elseif($uid == -2) {
echo '密码错误';
} else {
echo '未定义';
}
uc_user_synlogin() 这个函数 代表着 要同步登陆到其他所有开启同步登陆的函数 uc自己会在后台把所有开启同步登陆的应用都给循环遍历一遍 然后 在页面上输出
类似这种的js代码 ,就是发送给每个开启同步登陆的应用, 然后每个开启同步登陆的应用的回调文件 uc.php 接受到后会进行解密,解密好后其实你就可以自己来写代码了,这个uc.php回调文件的代码不一定非要按照他们的格式来写 ,你也可以自己写你自己的代码 。
其实UC的原理很简单 ,就是某个应用登陆后,然后后台轮询发送给同步登陆的应用的回调文件 ,回调文件接收到用户ID之后,生成cookie或者session然后进入登陆模式。
UCenter用户管理中心添加天天团购、记事狗微博的时为何老显示“通信失败”到底怎解决?高分答案
Ucenter通信原理
wenku.baidu.com/...1.html
本人是二本的通信工程专业,教非官方回答 学习通信原理的目的是什? 在什工作中的会起作用?
我也是二本通信的。
大学学通信不仅是选择自己的专业,还是选择自己的职业。既然选择了它,真的真的就要全心学好。工作时找对口工作。现在没兴趣的话就要尽快培养兴趣。通信可以说永远丢失朝阳产业,所以只要你学好了,不怕找不到好工作!
本科课程很多,每个学校也都不一样。但是主要的几门基础课肯定是会有的。《模电》《数点》《信号系统》《通信原理》。特别是信号,是通信的理论基础,一定一定要学好。其实说白了,也就是数学要学好。不管将来你要考研还是找工作,数学学好了绝对不会吃亏。特别是考研时特有用。哎,感慨一下。想增加学习通信的动力有很多,首先看看进入通信行业的工作有3年以上的工资都很高。而且外人看来很深奥的呢看来很简单,会很有成就感。直接的动力是你可以上通信之类的大网站论坛看看,或者看看比如《大话通信》之类的入门书籍。
希望这些信息对你有用。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

With the rapid development of social media, Xiaohongshu has become one of the most popular social platforms. Users can create a Xiaohongshu account to show their personal identity and communicate and interact with other users. If you need to find a user’s Xiaohongshu number, you can follow these simple steps. 1. How to use Xiaohongshu account to find users? 1. Open the Xiaohongshu APP, click the "Discover" button in the lower right corner, and then select the "Notes" option. 2. In the note list, find the note posted by the user you want to find. Click to enter the note details page. 3. On the note details page, click the "Follow" button below the user's avatar to enter the user's personal homepage. 4. In the upper right corner of the user's personal homepage, click the three-dot button and select "Personal Information"

When you log in to someone else's steam account on your computer, and that other person's account happens to have wallpaper software, steam will automatically download the wallpapers subscribed to the other person's account after switching back to your own account. Users can solve this problem by turning off steam cloud synchronization. What to do if wallpaperengine downloads other people's wallpapers after logging into another account 1. Log in to your own steam account, find cloud synchronization in settings, and turn off steam cloud synchronization. 2. Log in to someone else's Steam account you logged in before, open the Wallpaper Creative Workshop, find the subscription content, and then cancel all subscriptions. (In case you cannot find the wallpaper in the future, you can collect it first and then cancel the subscription) 3. Switch back to your own steam

With the rapid development of social media, Xiaohongshu has become a popular platform for many young people to share their lives and explore new products. During use, sometimes users may encounter difficulties logging into previous accounts. This article will discuss in detail how to solve the problem of logging into the old account on Xiaohongshu, and how to deal with the possibility of losing the original account after changing the binding. 1. How to log in to Xiaohongshu’s previous account? 1. Retrieve password and log in. If you do not log in to Xiaohongshu for a long time, your account may be recycled by the system. In order to restore access rights, you can try to log in to your account again by retrieving your password. The operation steps are as follows: (1) Open the Xiaohongshu App or official website and click the "Login" button. (2) Select "Retrieve Password". (3) Enter the mobile phone number you used when registering your account

In Ubuntu systems, the root user is usually disabled. To activate the root user, you can use the passwd command to set a password and then use the su- command to log in as root. The root user is a user with unrestricted system administrative rights. He has permissions to access and modify files, user management, software installation and removal, and system configuration changes. There are obvious differences between the root user and ordinary users. The root user has the highest authority and broader control rights in the system. The root user can execute important system commands and edit system files, which ordinary users cannot do. In this guide, I'll explore the Ubuntu root user, how to log in as root, and how it differs from a normal user. Notice

In the previous article (link), Xiao Zaojun introduced the development history of broadband technology from ISDN, xDSL to 10GPON. Today, let’s talk about the upcoming new generation of optical fiber broadband technology-50GPON. █F5G and F5G-A Before introducing 50GPON, let’s talk about F5G and F5G-A. In February 2020, ETSI (European Telecommunications Standards Institute) promoted a fixed communication network technology system based on 10GPON+FTTR, Wi-Fi6, 200G optical transmission/aggregation, OXC and other technologies, and named it F5G. That is, the fifth generation fixed network communication technology (The5thgenerationFixednetworks). F5G is a fixed network

Quark Netdisk and Baidu Netdisk are currently the most commonly used Netdisk software for storing files. If you want to save the files in Quark Netdisk to Baidu Netdisk, how do you do it? In this issue, the editor has compiled the tutorial steps for transferring files from Quark Network Disk computer to Baidu Network Disk. Let’s take a look at how to operate it. How to save Quark network disk files to Baidu network disk? To transfer files from Quark Network Disk to Baidu Network Disk, you first need to download the required files from Quark Network Disk, then select the target folder in the Baidu Network Disk client and open it. Then, drag and drop the files downloaded from Quark Cloud Disk into the folder opened by the Baidu Cloud Disk client, or use the upload function to add the files to Baidu Cloud Disk. Make sure to check whether the file was successfully transferred in Baidu Cloud Disk after the upload is completed. That's it

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

Recently, many netizens have asked the editor, what is the file hiberfil.sys? Can hiberfil.sys take up a lot of C drive space and be deleted? The editor can tell you that the hiberfil.sys file can be deleted. Let’s take a look at the details below. hiberfil.sys is a hidden file in the Windows system and also a system hibernation file. It is usually stored in the root directory of the C drive, and its size is equivalent to the size of the system's installed memory. This file is used when the computer is hibernated and contains the memory data of the current system so that it can be quickly restored to the previous state during recovery. Since its size is equal to the memory capacity, it may take up a larger amount of hard drive space. hiber
