修改异常信息
This commit is contained in:
parent
9740df6a97
commit
bd840134ad
@ -38,7 +38,7 @@ class Request extends \think\Request
|
|||||||
if ($e instanceof TokenInvalidException) {
|
if ($e instanceof TokenInvalidException) {
|
||||||
throw new FailedException('token 不合法', Code::LOST_LOGIN);
|
throw new FailedException('token 不合法', Code::LOST_LOGIN);
|
||||||
}
|
}
|
||||||
throw new FailedException('auth failed', Code::LOST_LOGIN);
|
throw new FailedException('认证失败: '. $e->getMessage(), Code::LOST_LOGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $user;
|
return $user;
|
||||||
|
10
extend/catcher/library/rate/GrantLimit.php
Normal file
10
extend/catcher/library/rate/GrantLimit.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | CatchAdmin [Just Like ~ ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||||
|
// +----------------------------------------------------------------------
|
36
extend/catcher/library/rate/Redis.php
Normal file
36
extend/catcher/library/rate/Redis.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | CatchAdmin [Just Like ~ ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | Author: JaguarJack [ njphper@gmail.com ]
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
namespace catcher\library;
|
||||||
|
|
||||||
|
use think\facade\Cache;
|
||||||
|
|
||||||
|
class Redis
|
||||||
|
{
|
||||||
|
protected $handle = null;
|
||||||
|
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
if (!$this->handle) {
|
||||||
|
$this->handle = Cache::store('redis')->handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function __call($name, $arguments)
|
||||||
|
{
|
||||||
|
// TODO: Implement __call() method.
|
||||||
|
return $this->handle->{$name}(...$arguments);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user