QQ联合登录有关问题
QQ联合登录问题
网站用QQ登录,用的腾讯提供的 JS -SDK,
就是引用他的JS代码,
用户用QQ登录后,在之前的登录页面会出现已登录的状态,
问题是怎么能在用户用QQ登录之后,直接跳转到指定的页面,
我看腾讯提供的JS里也没跳转功能的介绍,求解。。
------解决方案--------------------
sdk没有提到吗?没有提到的话就自己做跳转咯
------解决方案--------------------
登录成功后会有回调,在回调中做js页面跳转
------解决方案--------------------
回调函数中设置
- JScript code
QC.Login({ btnId : "qq_login_btn" },// 插入按钮的节点id function(dt,opts){ if(QC.Login.check()){//如果已登录 var openid=''; var nick=''; QC.Login.getMe(function(openId, accessToken){ openid=openId; }); //这里可以调用自己的保存接口 QC.api("get_user_info", '') //指定接口访问成功的接收函数,s为成功返回Response对象 .success(function(s){ nick=s.data.nickname; window.parent.window.location.href="userAction_saveT. action?openid="+openid+"&nick="+encodeURI(encodeURI(nick))+"&gender="+encodeURI(encodeURI(s.data.gender)); }) //指定接口访问失败的接收函数,f为失败返回Response对象 .error(function(f){ //失败回调 alert("获取用户信息失败!"); }) //指定接口完成请求后的接收函数,c为完成请求返回Response对象 .complete(function(c){ }); } }, function(opts){//注销成功 alert('QQ登录 注销成功'); } );
以上就是 QQ联合登录有关问题 的内容,更多相关内容请关注PHP中文网(www.php.cn)!

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



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...
