gamebackend/application/admin/controller/IndexController.php

65 lines
2.2 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
// +----------------------------------------------------------------------
// | 作者:修缘 联系QQ278896498 QQ群1054861244
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
// | 另接php业务网站制作、代理后台、gm后台、支付对接等
// +----------------------------------------------------------------------
// | 创建时间: 2022/1/4 12:54
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\admin\model\AdminLog;
use app\admin\model\AdminMenu;
use app\admin\model\AdminRole;
use app\admin\model\AdminUser;
use app\common\model\Index;
use app\common\model\User;
use think\facade\Lang;
use tools\SystemInfo;
use think\Request;
class IndexController extends Controller
{
protected function initialize(): void
{
parent::initialize(); // TODO: Change the autogenerated stub
$this->get_son_agency_account();
}
public function index(Request $request, Index $model)
{
$son_agency = $this->son_agency;
$index_config = config('admin.index');
//默认密码修改检测
$password_danger = 0;
if (1 === ((int)$this->user->id) && $index_config['password_warning'] && password_verify('super_admin', base64_decode($this->user->password))) {
$password_danger = 1;
}
//是否首页显示提示信息
$show_notice = $index_config['show_notice'];
//提示内容
$notice_content = $index_config['notice_content'];
$this->assign([
//系统信息
'system_info' => SystemInfo::getSystemInfo(),
//访问信息
'visitor_info' => $request,
//默认密码警告
'password_danger' => $password_danger,
//当前用户
'user' => $this->user,
//是否显示提示信息
'show_notice' => $show_notice,
//提示内容
'notice_content' => $notice_content,
'data' => $model::index_data($this->user, $this->son_agency, $this->directlySon),
]);
return $this->fetch();
}
}