更新前端文件
This commit is contained in:
@@ -26,6 +26,7 @@ class Admin {
|
||||
}
|
||||
|
||||
if ($request->isAjax()) {
|
||||
unset($this->data['config']);
|
||||
return json($this->data);
|
||||
} else {
|
||||
return $response->data($this->fetch());
|
||||
@@ -46,7 +47,8 @@ class Admin {
|
||||
'__public__' => '/static/admin',
|
||||
),
|
||||
);
|
||||
|
||||
return View::config($config)->assign($this->data)->fetch($template);
|
||||
$data = isset($this->data['data']) ? $this->data['data'] : [];
|
||||
$data['config'] = isset($this->data['config']) ? $this->data['config'] : $data;
|
||||
return View::config($config)->assign($data)->fetch($template);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class AdminAuth {
|
||||
* @title 显示菜单
|
||||
*/
|
||||
protected function getMenu($request) {
|
||||
$current_controller = str_replace('.', '/', strtolower($request->controller()));
|
||||
$current_controller = '/' . str_replace('.', '/', strtolower($request->controller()));
|
||||
$current_url = $current_controller . '/' . strtolower($request->action());
|
||||
$menu = Cache::get('menu');
|
||||
if (!$menu) {
|
||||
@@ -50,7 +50,7 @@ class AdminAuth {
|
||||
}
|
||||
$current_pid = 0;
|
||||
foreach ($menu as $key => $value) {
|
||||
if (strpos($value['url'], $current_controller) !== false) {
|
||||
if (strpos($value['url'], $current_controller.'/') !== false) {
|
||||
if ($value['pid'] == 0) {
|
||||
$current_pid = $value['id'];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user