Files
YwxAppThink/addon/blog/controller/backend/Index.php
T

45 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | YwxApp [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2026-2036 http://ywxapp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: ywxapp<admin@ywxapp.cn>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace addon\blog\controller\backend;
use think\facade\View;
use ywxapp\controller\BackendBase;
/**
* 插件后台入口页(addon/blog/controller/admin/Index.php
*
* 继承 AddonBackend,并处于 route/app.php 的 admin 路由组中,
* 该组已挂 \addon\blog\middleware\AdminAuth 中间件,自动将 auth 绑定为管理员并强制登录。
*/
class Index extends BackendBase
{
protected $noNeedVerify = ['*'];
protected function initialize()
{}
/**
* 后台首页
*/
public function index()
{
$admin = $this->auth->info ?? null;
// 同时赋值 user,供 layout.html 头部的 {$user.nickname} 使用
$this->view->assign('member', $admin);
return View::fetch('index/index', [
'backend' => $admin,
]);
}
}