|
@@ -94,12 +94,10 @@ class Auth
|
|
|
return false;
|
|
|
}
|
|
|
$data = Token::get($token);
|
|
|
- @file_put_contents('data.txt',json_encode($data));
|
|
|
if (!$data) {
|
|
|
return false;
|
|
|
}
|
|
|
$user_id = intval($data['user_id']);
|
|
|
- @file_put_contents('data.txt','-1111--'.$user_id,8);
|
|
|
if ($user_id > 0) {
|
|
|
$user = User::get($user_id);
|
|
|
if (!$user) {
|
|
@@ -113,10 +111,8 @@ class Auth
|
|
|
$this->_user = $user;
|
|
|
$this->_logined = true;
|
|
|
$this->_token = $token;
|
|
|
-
|
|
|
//初始化成功的事件
|
|
|
Hook::listen("user_init_successed", $this->_user);
|
|
|
-
|
|
|
return true;
|
|
|
} else {
|
|
|
$this->setError('You are not logged in');
|