Files
huangjingfen/pro_v3.5.1/app/controller/admin/AuthController.php
panchengyong c1e74d8e68 chore(php): 统一 ScottPan 文件头与注释域名替换
- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明

Made-with: Cursor
2026-03-29 11:22:58 +08:00

75 lines
1.6 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace app\controller\admin;
use app\Request;
use crmeb\basic\BaseController;
use think\Response;
/**
* 基类 所有控制器继承的类
* Class AuthController
* @package app\controller\admin
* @property Request $request
* @method Response success($message = '', array $data = [])
* @method Response fail($message = '', array $data = [])
*/
class AuthController extends BaseController
{
/**
* 当前登陆管理员信息
* @var array
*/
protected $adminInfo = [];
/**
* 当前登陆管理员ID
* @var int
*/
protected $adminId = 0;
protected $supplierId = 0;
/**
* 当前登陆管理员类型 4 是供应商
* @var int
*/
protected $adminType = 1;
/**
* 当前管理员权限
* @var array
*/
protected $auth = [];
/**
* 初始化
*/
protected function initialize()
{
$this->loadAdminInfo();
}
/**
* 加载管理员信息
*/
protected function loadAdminInfo()
{
$this->adminId = $this->request->hasMacro('adminId') ? (int)$this->request->adminId() : 0;
$this->adminInfo = $this->request->hasMacro('adminInfo') ? (array)$this->request->adminInfo() : [];
$this->adminType = $this->adminInfo['admin_type'] ?? 1;
if ($this->adminType == 4) {
$this->supplierId = $this->adminId;
}
$this->auth = $this->adminInfo['rule'] ?? [];
}
}