!212 补充Auth兼容调用user模型的属性

Merge pull request !212 from caiqy/master
pull/212/MERGE
Karson 2021-03-10 14:19:11 +08:00 committed by Gitee
commit f815edab04
1 changed files with 8 additions and 0 deletions

View File

@ -70,6 +70,14 @@ class Auth
return $this->_user ? $this->_user->$name : null;
}
/**
* 兼容调用user模型的属性
*/
public function __isset($name)
{
return isset($this->_user) ? isset($this->_user->$name) : false;
}
/**
* 根据Token初始化
*