mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 14:59:14 +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()
|
protected function getUser()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
$user = UserService::instance();
|
||||||
if (empty($this->uuid)) {
|
if (empty($this->uuid)) {
|
||||||
$token = input('token') ?: $this->request->header('token');
|
$token = input('token') ?: $this->request->header('token');
|
||||||
if (empty($token)) $this->error('接口认证令牌不能为空!');
|
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);
|
if (empty($state)) $this->error($message);
|
||||||
}
|
}
|
||||||
return UserService::instance()->get($this->type, $this->uuid);
|
return $user->get($this->type, $this->uuid);
|
||||||
} catch (HttpResponseException $exception) {
|
} catch (HttpResponseException $exception) {
|
||||||
throw $exception;
|
throw $exception;
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user