分离后台和用户中心登录状态
This commit is contained in:
@@ -14,6 +14,7 @@ use app\model\AuthGroup;
|
||||
use app\model\Menu;
|
||||
use app\model\Model;
|
||||
use think\facade\View;
|
||||
use think\facade\Config;
|
||||
|
||||
class Base extends BaseC {
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class Index extends Base {
|
||||
try {
|
||||
$userinfo = $user->login($this->request);
|
||||
if ($userinfo) {
|
||||
Session::set('userInfo', $userinfo);
|
||||
Session::set('adminInfo', $userinfo);
|
||||
return $this->success('登录成功!', url('/admin/index/index'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
@@ -64,7 +64,7 @@ class Index extends Base {
|
||||
* @return html
|
||||
*/
|
||||
public function logout(Member $user) {
|
||||
Session::delete('userInfo');
|
||||
Session::delete('adminInfo');
|
||||
$this->redirect('/admin/login');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user