后台登录验证代码

原创 2019-05-10 22:20:21 267
摘要:<?phpnamespace app\admin\controller;use think\App;use think\Controller;use think\facade\Session;class Common extends Controller{    public function __construct()    {   &nb

<?php
namespace app\admin\controller;

use think\App;
use think\Controller;
use think\facade\Session;

class Common extends Controller
{
   public function __construct()
   {
       parent::__construct();
       if (!Session::has('username')) {
           $this->error('您还未登录!请返回登录!','Login/login');
       }
   }
}

批改老师:查无此人批改时间:2019-05-13 09:41:08
老师总结:公用文件,判断用户是否登录。前端页面代码还没写吗?继续加油。

发布手记

热门词条