深圳市一览网络股份有限
公司
ShenZhen Elanw Network
Co.,Ltd.
地址:南山科技园南区数字技术园
B2 栋 4A
Add: Room A,4th Floor,Block
B2,Digi-Tech Park ,
电话(Tel):0755-86133725
传真(Fax):0755-22632616
网址
(Web):www.YL1001.com
public
function
get_login_code(){
if
(
$this
->_logincode)
return
$this
->_logincode;
$t
= time().
strval
(mt_rand(100,999));
$codeurl
= '
https://login.weixin.qq.com/jslogin?appid=wx782c26e4c19acffb&redirect_uri=https%3A
%2F%2Fwx.qq.com%2Fcgi-bin%2Fmmwebwx-bin%2Fwebwxnewloginpage&fun=new&lang=zh_CN&_=§
'.
$t
;
$send_snoopy
=
new
Snoopy;
$send_snoopy
->fetch(
$codeurl
);
$result
=
$send_snoopy
->results;
if
(
$result
) {
preg_match("/window.QRLogin.uuid\s+=\s+\"([^\"]+)\"/",
$result
,
$matches
);
if
(
count
(
$matches
)>1) {
$this
->_logincode =
$matches
[1];
$_SESSION
['login_step'] = 0;
return
$this
->_logincode;
}
}
return
$result
;
}
/**
* 通过授权码获取对应的二维码图片地址
* @param string $code
* @return string image url
*/
public
function
get_code_image(
$code
=''){
if
(
$code
=='')
$code
=
$this
->_logincode;
if
(!
$code
)
return
false;
return
http://login.weixin.qq.com/qrcode/§
'.
$this
->_logincode.'?t=webwx';
}
/**
* 设置二维码对应的授权码
* @param string $code
* @return class $this
*/
public
function
set_login_code(
$code
) {
$this
->_logincode =
$code
;
return
$this
;
}
/**
* 二维码登陆验证
*
* @return status: