超管后台 - 新建项目返工

This commit is contained in:
柳清爽
2025-04-17 14:34:31 +08:00
parent b18c70b7c6
commit 42e189ac01
10 changed files with 415 additions and 102 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace app\superadmin\controller;
use think\Controller;
/**
* 设备管理控制器
*/
class BaseController extends Controller
{
/**
* 用户信息
* @var object
*/
protected $user;
/**
* 初始化
*/
protected function initialize()
{
parent::initialize();
date_default_timezone_set('Asia/Shanghai');
}
/**
* 获取用户信息
*
* @param string $column
* @return mixed
* @throws \Exception
*/
protected function getUserInfo(string $column = '')
{
$user = $this->request->userInfo;
if (!$user) {
throw new \Exception('未授权访问,缺少有效的身份凭证', 401);
}
return $column ? $user[$column] : $user;
}
}