团队管理

This commit is contained in:
kuaifan
2021-06-29 11:41:18 +08:00
parent 11eb8000b3
commit a5e62b25f3
15 changed files with 704 additions and 37 deletions
+8 -1
View File
@@ -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;
}