团队管理
This commit is contained in:
+8
-1
@@ -267,9 +267,10 @@ class User extends AbstractModel
|
||||
|
||||
/**
|
||||
* 用户身份认证(获取用户信息)
|
||||
* @param null $identity 判断身份
|
||||
* @return self
|
||||
*/
|
||||
public static function auth()
|
||||
public static function auth($identity = null)
|
||||
{
|
||||
$user = self::authInfo();
|
||||
if (!$user) {
|
||||
@@ -280,6 +281,12 @@ class User extends AbstractModel
|
||||
throw new ApiException('请登录后继续...', [], -1);
|
||||
}
|
||||
}
|
||||
if (in_array('disable', $user->identity)) {
|
||||
throw new ApiException('帐号已停用...', [], -1);
|
||||
}
|
||||
if ($identity) {
|
||||
$user->identity($identity);
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user