65 lines
2.2 KiB
PHP
Raw Normal View History

2025-01-20 18:00:25 +08:00
<?php
namespace app\manystoreapi\controller;
use app\common\controller\ManystoreApiBase;
/**
* 机构API后台首页接口
*/
class Index extends ManystoreApiBase
{
protected $noNeedLogin = [];
// protected $noNeedRight = ['index'];
protected $layout = '';
public function _initialize()
{
parent::_initialize();
//移除HTML标签
$this->request->filter('trim,strip_tags,htmlspecialchars');
}
/**
* 后台首页
*/
public function index()
{
//左侧菜单
$cookieArr = ['adminskin' => "/^skin\-([a-z\-]+)\$/i", 'multiplenav' => "/^(0|1)\$/", 'multipletab' => "/^(0|1)\$/", 'show_submenu' => "/^(0|1)\$/"];
foreach ($cookieArr as $key => $regex) {
$cookieValue = $this->request->cookie($key);
if (!is_null($cookieValue) && preg_match($regex, $cookieValue)) {
config('fastadmin.' . $key, $cookieValue);
}
}
list($menulist, $navlist, $fixedmenu, $referermenu) = $this->auth->getSidebar([
'dashboard' => 'hot',
'addon' => ['new', 'red', 'badge'],
'auth/rule' => __('Menu'),
'general' => ['new', 'purple'],
], $this->view->site['fixedpage']);
$action = $this->request->request('action');
// if ($this->request->isPost()) {
$this->apisuccess('', [
'menulist' => $menulist,
'navlist' => $navlist,
'cookie' => ['prefix' => config('cookie.prefix')],
"fixedmenu" =>$fixedmenu,
"referermenu" =>$referermenu,
"title", __('Home'),
2025-02-07 14:50:18 +08:00
"attachmentcategory"=>config("site.attachmentcategory")
2025-01-20 18:00:25 +08:00
]);
// }
// $this->assignconfig('cookie', ['prefix' => config('cookie.prefix')]);
// $this->view->assign('menulist', $menulist);
// $this->view->assign('navlist', $navlist);
// $this->view->assign('fixedmenu', $fixedmenu);
// $this->view->assign('referermenu', $referermenu);
// $this->view->assign('title', __('Home'));
// return $this->view->fetch();
}
}