thinkphp 5 登陆退出session登陆状态检测

1,访问http://localhost/tp5/admin.php时,判断有没有登陆:

想法:写一个父类,继承controller,然后定义一个初始化方法,在控制器调用时就判断是否登陆

thinkphp 5 登陆退出session登陆状态检测
登陆界面:

thinkphp 5 登陆退出session登陆状态检测
thinkphp 5 登陆退出session登陆状态检测

登陆控制器:

thinkphp 5 登陆退出session登陆状态检测

thinkphp 5 登陆退出session登陆状态检测
如果失败,回到登陆页面;如果登陆成功,跳转到后台首页:
thinkphp 5 登陆退出session登陆状态检测
后台首页面:
thinkphp 5 登陆退出session登陆状态检测

相关文章: