<?php /** * Created by PhpStorm. * User: Administrator * Date: 2018/1/10 * Time: 11:26 */ namespace app\admin\controller; use think\Controller; use think\Session; class Base extends Controller { public function __construct() { //访问父类的构造方法 parent::__construct(); //判断是否登录 if (empty(Session::get('uid'))) { $url = url('login/index'); $script = "<script>top.location.href='$url'</script>"; echo $script; exit(); } } }
相关文章
- 我有两个django站点。我如何判断用户是否已经通过其中之一进行了身份验证?
- 基于Servlet+JSP+JavaBean开发模式的用户登录注册
- 制作登录页面,点击键盘的 Enter 键或者单击“登录”按钮,验证用户输入的邮箱和密码是否正确
- c语言模拟用户输入三次密码并判断是否正确
- phpcms如何判断用户是否登录
- ajax来判断用户是否登录与添加
- MVC 自定义特性(验证用户登录session是否已经过期)
- 【转载】 javaweb学习总结(二十二)——基于Servlet+JSP+JavaBean开发模式的用户登录注册 - 孤傲苍狼 - 博 http://www.cnblogs.com/xdp-gacl/
- 用户输入一个数字,判断这个数字是否是质数。
- javaweb学习总结(二十二)——基于Servlet+JSP+JavaBean开发模式的用户登录注册