后台
This commit is contained in:
@@ -10,10 +10,10 @@ use think\facade\Log;
|
||||
use Throwable;
|
||||
use ba\Random;
|
||||
use think\facade\Db;
|
||||
use think\facade\Config;
|
||||
use app\admin\model\Admin;
|
||||
use app\common\facade\Token;
|
||||
use app\admin\model\AdminGroup;
|
||||
use Webman\Config;
|
||||
|
||||
/**
|
||||
* 管理员权限类
|
||||
@@ -23,7 +23,7 @@ use app\admin\model\AdminGroup;
|
||||
* @property string $email 管理员邮箱
|
||||
* @property string $mobile 管理员手机号
|
||||
*/
|
||||
class Auth extends \ba\Auth
|
||||
class Auth extends \extend\ba\Auth
|
||||
{
|
||||
/**
|
||||
* 需要登录时/无需登录时的响应状态代码
|
||||
@@ -352,38 +352,9 @@ class Auth extends \ba\Auth
|
||||
}
|
||||
|
||||
|
||||
public function checkmenus($url, $uid): bool
|
||||
{
|
||||
return parent::checkmenus($url, $uid ?: $this->user_id);
|
||||
}
|
||||
public function getUserMenus($uid):array
|
||||
{
|
||||
return parent::getUserMenus($uid);
|
||||
}
|
||||
public function check(string $name, int $uid = 0, string $relation = 'or', string $mode = 'url'): bool
|
||||
{
|
||||
return parent::check($name, $uid ?: $this->id, $relation, $mode);
|
||||
}
|
||||
|
||||
public function getGroups(int $uid = 0): array
|
||||
{
|
||||
return parent::getGroups($uid ?: $this->id);
|
||||
}
|
||||
|
||||
public function getRuleList(int $uid = 0): array
|
||||
{
|
||||
return parent::getRuleList($uid ?: $this->id);
|
||||
}
|
||||
|
||||
public function getRuleIds(int $uid = 0): array
|
||||
{
|
||||
return parent::getRuleIds($uid ?: $this->id);
|
||||
}
|
||||
|
||||
public function getMenus(int $uid = 0): array
|
||||
{
|
||||
return parent::getMenus($uid ?: $this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是超级管理员
|
||||
|
||||
@@ -3,19 +3,25 @@
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
use think\captcha\facade\Captcha as thinkCaptcha;
|
||||
use Webman\Captcha\CaptchaBuilder;
|
||||
use support\Request;
|
||||
|
||||
class SysCaptcha extends Model
|
||||
{
|
||||
public static function getCode($uuid)
|
||||
public static function getCode($uuid, $request)
|
||||
{
|
||||
$code_data = thinkCaptcha::create('czg');
|
||||
// 初始化验证码类
|
||||
$builder = new CaptchaBuilder;
|
||||
// 生成验证码
|
||||
$builder->build();
|
||||
// 获得验证码图片二进制数据
|
||||
$img_content = $builder->inline();
|
||||
// 保存至数据库
|
||||
self::create([
|
||||
'uuid' => $uuid,
|
||||
'code' => $code_data['code'],
|
||||
'expire_time' => date('Y-m-d H:i:s', time() + config('captcha.expire_time')),
|
||||
'code' => $builder->getPhrase(),
|
||||
'expire_time' => date('Y-m-d H:i:s', time() + 600),
|
||||
]);
|
||||
return ['img' => $code_data['img']];
|
||||
return ['img' => $img_content];
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\common\library\DatabaseRoute;
|
||||
use think\facade\Cache;
|
||||
use support\think\Cache;
|
||||
use think\facade\Db;
|
||||
use think\Model;
|
||||
use think\model\relation\BelongsTo;
|
||||
|
||||
Reference in New Issue
Block a user