abstract:<?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');
}
}
}
Correcting teacher:查无此人Correction time:2019-05-13 09:41:08
Teacher's summary:公用文件,判断用户是否登录。前端页面代码还没写吗?继续加油。