...
|
...
|
@@ -40,7 +40,7 @@ class WxloginController extends HomeBaseController |
|
|
}
|
|
|
}
|
|
|
parent::_initialize(); // TODO: Change the autogenerated stub
|
|
|
if(!Session::get('user.accessToken')){
|
|
|
if(!Session::get('user.accessToken') || !Session::get('uid')){
|
|
|
session('uid',null);
|
|
|
session('user.accessToken',null);
|
|
|
session('user.accessTime',null);
|
...
|
...
|
@@ -82,17 +82,11 @@ class WxloginController extends HomeBaseController |
|
|
* Main:授权登录 获取openid
|
|
|
*/
|
|
|
public function OAuth($redirect_uri){
|
|
|
echo "<pre/>";
|
|
|
print_r('4444');
|
|
|
print_r(Session::get('uid'));
|
|
|
die;
|
|
|
if (!Session::get('uid')) {
|
|
|
$url = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
|
|
$temp_one = explode('code=',$url);
|
|
|
if(!empty($temp_one[1])){
|
|
|
echo "<pre/>";
|
|
|
print_r('333');
|
|
|
die;
|
|
|
|
|
|
$temp_two = explode('&state',$temp_one[1]);
|
|
|
if ($temp_two[0]) {
|
|
|
//第二步 获取access_token
|
...
|
...
|
@@ -138,10 +132,7 @@ class WxloginController extends HomeBaseController |
|
|
}
|
|
|
}else{
|
|
|
$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=".Config::get('WX_APPID')."&redirect_uri=" . $redirect_uri . "&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
|
|
|
echo "<pre/>";
|
|
|
print_r(111111111);
|
|
|
print_r($redirect_uri);
|
|
|
die;
|
|
|
|
|
|
Header("Location: $url");
|
|
|
exit;
|
|
|
}
|
...
|
...
|
|