mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +08:00
Update Auth.php
This commit is contained in:
parent
57780a39b4
commit
eaafaf8a10
@ -48,13 +48,14 @@ abstract class Auth extends Controller
|
||||
protected function getUser()
|
||||
{
|
||||
try {
|
||||
$user = UserService::instance();
|
||||
if (empty($this->uuid)) {
|
||||
$token = input('token') ?: $this->request->header('token');
|
||||
if (empty($token)) $this->error('接口认证令牌不能为空!');
|
||||
[$state, $message, $this->uuid] = UserService::instance()->checkUserToken($this->type, $token);
|
||||
[$state, $message, $this->uuid] = $user->checkUserToken($this->type, $token);
|
||||
if (empty($state)) $this->error($message);
|
||||
}
|
||||
return UserService::instance()->get($this->type, $this->uuid);
|
||||
return $user->get($this->type, $this->uuid);
|
||||
} catch (HttpResponseException $exception) {
|
||||
throw $exception;
|
||||
} catch (\Exception $exception) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user