mirror of https://gitee.com/karson/fastadmin.git
parent
dd8f2363fb
commit
f764bc98c7
|
|
@ -77,6 +77,8 @@ class Index extends Backend
|
||||||
//保持会话有效时长,单位:小时
|
//保持会话有效时长,单位:小时
|
||||||
$keeyloginhours = 24;
|
$keeyloginhours = 24;
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
|
AdminLog::setTitle(__('Login'));
|
||||||
|
|
||||||
$username = $this->request->post('username');
|
$username = $this->request->post('username');
|
||||||
$password = $this->request->post('password', '', null);
|
$password = $this->request->post('password', '', null);
|
||||||
$keeplogin = $this->request->post('keeplogin');
|
$keeplogin = $this->request->post('keeplogin');
|
||||||
|
|
@ -132,6 +134,13 @@ class Index extends Backend
|
||||||
public function logout()
|
public function logout()
|
||||||
{
|
{
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
|
$user_id = $this->auth->id;
|
||||||
|
$username = $this->auth->username;
|
||||||
|
AdminLog::event('before_insert', function ($row) use ($user_id, $username) {
|
||||||
|
$row->admin_id = $user_id;
|
||||||
|
$row->username = $username;
|
||||||
|
});
|
||||||
|
AdminLog::setTitle(__('Logout'));
|
||||||
$this->auth->logout();
|
$this->auth->logout();
|
||||||
Hook::listen("admin_logout_after", $this->request);
|
Hook::listen("admin_logout_after", $this->request);
|
||||||
$this->success(__('Logout successful'), 'index/login');
|
$this->success(__('Logout successful'), 'index/login');
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ class AdminLog extends Model
|
||||||
protected static $content = '';
|
protected static $content = '';
|
||||||
//忽略的链接正则列表
|
//忽略的链接正则列表
|
||||||
protected static $ignoreRegex = [
|
protected static $ignoreRegex = [
|
||||||
'/^(.*)\/(selectpage|index)$/i',
|
'/^(.*)\/(selectpage|index|get_table_list|get_fields_list)$/i',
|
||||||
'/^(.*)\/addon\/get_table_list$/i',
|
'/^(.*)\/auth\/group\/roletree$/i',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static function setTitle($title)
|
public static function setTitle($title)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue