mirror of https://gitee.com/karson/fastadmin.git
parent
dd3f951f13
commit
55473c9029
|
|
@ -87,6 +87,8 @@ class Index extends Backend
|
|||
{
|
||||
$this->redirect($url);
|
||||
}
|
||||
$background = cdnurl("/assets/img/loginbg.jpg");
|
||||
$this->view->assign('background', $background);
|
||||
\think\Hook::listen("login_init", $this->request);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Config extends Backend
|
|||
{
|
||||
if (in_array($params['type'], ['select', 'selects', 'checkbox', 'radio', 'array']))
|
||||
{
|
||||
$params['content'] = ConfigModel::decode($params['content']);
|
||||
$params['content'] = json_encode(ConfigModel::decode($params['content']), JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -133,7 +133,7 @@ class Config extends Backend
|
|||
$value = $row[$v['name']];
|
||||
if (is_array($value) && isset($value['field']))
|
||||
{
|
||||
$value = json_encode(\app\common\model\Config::getArrayData($value), JSON_UNESCAPED_UNICODE);
|
||||
$value = json_encode(ConfigModel::getArrayData($value), JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ class Auth extends \fast\Auth
|
|||
|
||||
protected $requestUri = '';
|
||||
protected $breadcrumb = [];
|
||||
protected $loginUnique = false; //是否同一账号同一时间只能在一个地方登录
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
|
@ -153,7 +154,21 @@ class Auth extends \fast\Auth
|
|||
*/
|
||||
public function isLogin()
|
||||
{
|
||||
return Session::get('admin') ? true : false;
|
||||
$admin = Session::get('admin');
|
||||
if (!$admin)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//判断是否同一时间同一账号只能在一个地方登录
|
||||
if ($this->loginUnique)
|
||||
{
|
||||
$my = Admin::get($admin->id);
|
||||
if (!$my || $my->token != $admin->token)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<style type="text/css">
|
||||
body {
|
||||
color:#999;
|
||||
background:url('__CDN__/assets/img/loginbg.jpg');
|
||||
background:url('{$background}');
|
||||
background-size:cover;
|
||||
}
|
||||
a {
|
||||
|
|
|
|||
Loading…
Reference in New Issue