...
|
...
|
@@ -23,12 +23,18 @@ class WxloginController extends HomeBaseController |
|
|
*/
|
|
|
public function _initialize()
|
|
|
{
|
|
|
$expUrl = explode('/',$_SERVER['REQUEST_URI']);
|
|
|
if(count($expUrl) == 4){
|
|
|
$rediUrl = 'http://' .$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
|
|
}else{
|
|
|
$rediUrl = 'http://' .$_SERVER['HTTP_HOST'];
|
|
|
}
|
|
|
parent::_initialize(); // TODO: Change the autogenerated stub
|
|
|
if(!Session::get('user.accessToken')){
|
|
|
session('uid',null);
|
|
|
session('user.accessToken',null);
|
|
|
session('user.accessTime',null);
|
|
|
$this->OAuth('http://' .$_SERVER['HTTP_HOST']);
|
|
|
$this->OAuth($rediUrl);
|
|
|
}else{
|
|
|
// 判断accesstoken时间
|
|
|
$overTime = Session::get('user.accessTime');
|
...
|
...
|
@@ -37,16 +43,16 @@ class WxloginController extends HomeBaseController |
|
|
session('uid',null);
|
|
|
session('user.accessToken',null);
|
|
|
session('user.accessTime',null);
|
|
|
$this->OAuth('http://' .$_SERVER['HTTP_HOST']);
|
|
|
$this->OAuth($rediUrl);
|
|
|
}else{
|
|
|
// 未超过
|
|
|
// 查询用户是否存在
|
|
|
$uid = Session::get('uid');
|
|
|
$id = Db::name('Member')->where(array('id'=>$uid,'status'=>1))->value('id');
|
|
|
if(!$id){
|
|
|
$this->OAuth('http://' .$_SERVER['HTTP_HOST']);
|
|
|
$this->OAuth($rediUrl);
|
|
|
}else{
|
|
|
$url = 'http://' .$_SERVER['HTTP_HOST'];
|
|
|
$url = $rediUrl;
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|