后台首页未登录时不提示错误直接跳转登录页面

pull/98/MERGE
pppscn 2019-02-16 14:51:16 +08:00 committed by Karson
parent 49464f6135
commit 366bc7864c
1 changed files with 4 additions and 0 deletions

View File

@ -139,6 +139,10 @@ class Backend extends Controller
Hook::listen('admin_nologin', $this);
$url = Session::get('referer');
$url = $url ? $url : $this->request->url();
if ($url == '/') {
$this->redirect('index/login', [], 302, ['referer' => $url]);
exit;
}
$this->error(__('Please login first'), url('index/login', ['url' => $url]));
}
// 判断是否需要验证权限