修改异常信息

This commit is contained in:
JaguarJack 2020-06-30 17:42:07 +08:00
parent 9740df6a97
commit bd840134ad
6 changed files with 47 additions and 1 deletions

View File

@ -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;

View 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 ]
// +----------------------------------------------------------------------

View 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);
}
}