diff --git a/app/Http/Admin/Controllers/AuditController.php b/app/Http/Admin/Controllers/AuditController.php index 84e7251d..e946ad68 100644 --- a/app/Http/Admin/Controllers/AuditController.php +++ b/app/Http/Admin/Controllers/AuditController.php @@ -39,7 +39,10 @@ class AuditController extends Controller $audit = $auditService->getAudit($id); + $region = kg_ip2region($audit->user_ip); + $this->view->setVar('audit', $audit); + $this->view->setVar('region', $region); } } diff --git a/app/Http/Admin/Controllers/GroupController.php b/app/Http/Admin/Controllers/ImGroupController.php similarity index 76% rename from app/Http/Admin/Controllers/GroupController.php rename to app/Http/Admin/Controllers/ImGroupController.php index 4ce56787..e2ef3b02 100644 --- a/app/Http/Admin/Controllers/GroupController.php +++ b/app/Http/Admin/Controllers/ImGroupController.php @@ -5,13 +5,13 @@ namespace App\Http\Admin\Controllers; use App\Http\Admin\Services\ImGroup as ImGroupService; /** - * @RoutePrefix("/admin/group") + * @RoutePrefix("/admin/im/group") */ -class GroupController extends Controller +class ImGroupController extends Controller { /** - * @Get("/list", name="admin.group.list") + * @Get("/list", name="admin.im_group.list") */ public function listAction() { @@ -23,7 +23,7 @@ class GroupController extends Controller } /** - * @Get("/search", name="admin.group.search") + * @Get("/search", name="admin.im_group.search") */ public function searchAction() { @@ -31,7 +31,7 @@ class GroupController extends Controller } /** - * @Get("/add", name="admin.group.add") + * @Get("/add", name="admin.im_group.add") */ public function addAction() { @@ -39,7 +39,7 @@ class GroupController extends Controller } /** - * @Post("/create", name="admin.group.create") + * @Post("/create", name="admin.im_group.create") */ public function createAction() { @@ -48,7 +48,7 @@ class GroupController extends Controller $group = $groupService->createGroup(); $location = $this->url->get([ - 'for' => 'admin.group.edit', + 'for' => 'admin.im_group.edit', 'id' => $group->id, ]); @@ -61,7 +61,7 @@ class GroupController extends Controller } /** - * @Get("/{id:[0-9]+}/edit", name="admin.group.edit") + * @Get("/{id:[0-9]+}/edit", name="admin.im_group.edit") */ public function editAction($id) { @@ -73,7 +73,7 @@ class GroupController extends Controller } /** - * @Post("/{id:[0-9]+}/update", name="admin.group.update") + * @Post("/{id:[0-9]+}/update", name="admin.im_group.update") */ public function updateAction($id) { @@ -81,7 +81,7 @@ class GroupController extends Controller $groupService->updateGroup($id); - $location = $this->url->get(['for' => 'admin.group.list']); + $location = $this->url->get(['for' => 'admin.im_group.list']); $content = [ 'location' => $location, @@ -92,7 +92,7 @@ class GroupController extends Controller } /** - * @Post("/{id:[0-9]+}/delete", name="admin.group.delete") + * @Post("/{id:[0-9]+}/delete", name="admin.im_group.delete") */ public function deleteAction($id) { @@ -111,7 +111,7 @@ class GroupController extends Controller } /** - * @Post("/{id:[0-9]+}/restore", name="admin.group.restore") + * @Post("/{id:[0-9]+}/restore", name="admin.im_group.restore") */ public function restoreAction($id) { diff --git a/app/Http/Admin/Services/AuthNode.php b/app/Http/Admin/Services/AuthNode.php index 3a270a6b..ff8ccd46 100644 --- a/app/Http/Admin/Services/AuthNode.php +++ b/app/Http/Admin/Services/AuthNode.php @@ -24,17 +24,44 @@ class AuthNode extends Service 'id' => '1', 'title' => '内容管理', 'children' => [ + [ + 'id' => '1-2', + 'title' => '分类管理', + 'type' => 'button', + 'children' => [ + [ + 'id' => '1-2-1', + 'title' => '分类列表', + 'type' => 'button', + 'route' => 'admin.category.list', + 'params' => ['type' => 'course'], + ], + [ + 'id' => '1-2-2', + 'title' => '添加分类', + 'type' => 'button', + 'route' => 'admin.category.add', + 'params' => ['type' => 'course'], + ], + [ + 'id' => '1-2-3', + 'title' => '编辑分类', + 'type' => 'button', + 'route' => 'admin.category.edit', + ], + [ + 'id' => '1-2-4', + 'title' => '删除分类', + 'type' => 'button', + 'route' => 'admin.category.delete', + ], + ], + ], [ 'id' => '1-1', 'title' => '课程管理', 'type' => 'menu', 'children' => [ - [ - 'id' => '1-1-0', - 'title' => '课程分类', - 'type' => 'menu', - 'route' => 'admin.course.category', - ], [ 'id' => '1-1-1', 'title' => '课程列表', @@ -65,38 +92,11 @@ class AuthNode extends Service 'type' => 'button', 'route' => 'admin.course.edit', ], - ], - ], - [ - 'id' => '1-2', - 'title' => '分类管理', - 'type' => 'menu', - 'children' => [ [ - 'id' => '1-2-1', - 'title' => '分类列表', + 'id' => '1-1-6', + 'title' => '课程分类', 'type' => 'menu', - 'route' => 'admin.category.list', - 'params' => ['type' => 'course'], - ], - [ - 'id' => '1-2-2', - 'title' => '添加分类', - 'type' => 'menu', - 'route' => 'admin.category.add', - 'params' => ['type' => 'course'], - ], - [ - 'id' => '1-2-3', - 'title' => '编辑分类', - 'type' => 'button', - 'route' => 'admin.category.edit', - ], - [ - 'id' => '1-2-4', - 'title' => '删除分类', - 'type' => 'button', - 'route' => 'admin.category.delete', + 'route' => 'admin.course.category', ], ], ], @@ -204,12 +204,6 @@ class AuthNode extends Service 'title' => '帮助管理', 'type' => 'menu', 'children' => [ - [ - 'id' => '1-6-0', - 'title' => '帮助分类', - 'type' => 'menu', - 'route' => 'admin.help.category', - ], [ 'id' => '1-6-1', 'title' => '帮助列表', @@ -234,6 +228,12 @@ class AuthNode extends Service 'type' => 'button', 'route' => 'admin.help.delete', ], + [ + 'id' => '1-6-5', + 'title' => '帮助分类', + 'type' => 'menu', + 'route' => 'admin.help.category', + ], ], ], ], @@ -348,31 +348,31 @@ class AuthNode extends Service 'id' => '2-4-1', 'title' => '群组列表', 'type' => 'menu', - 'route' => 'admin.group.list', + 'route' => 'admin.im_group.list', ], [ 'id' => '2-4-2', 'title' => '搜索群组', 'type' => 'menu', - 'route' => 'admin.group.search', + 'route' => 'admin.im_group.search', ], [ 'id' => '2-4-3', 'title' => '添加群组', 'type' => 'menu', - 'route' => 'admin.group.add', + 'route' => 'admin.im_group.add', ], [ 'id' => '2-4-4', 'title' => '编辑群组', 'type' => 'button', - 'route' => 'admin.group.edit', + 'route' => 'admin.im_group.edit', ], [ 'id' => '2-4-5', 'title' => '删除群组', 'type' => 'button', - 'route' => 'admin.group.delete', + 'route' => 'admin.im_group.delete', ], ], ], diff --git a/app/Http/Admin/Services/Nav.php b/app/Http/Admin/Services/Nav.php index 0ab819bc..08af6d8b 100644 --- a/app/Http/Admin/Services/Nav.php +++ b/app/Http/Admin/Services/Nav.php @@ -89,6 +89,7 @@ class Nav extends Service $nav->update(); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; @@ -138,6 +139,7 @@ class Nav extends Service $nav->update($data); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; @@ -156,6 +158,7 @@ class Nav extends Service $nav->update(); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; @@ -170,6 +173,7 @@ class Nav extends Service $nav->update(); $this->updateNavStats($nav); + $this->rebuildNavCache(); return $nav; diff --git a/app/Http/Admin/Views/audit/list.volt b/app/Http/Admin/Views/audit/list.volt index 14c36f5b..6c43fbb5 100644 --- a/app/Http/Admin/Views/audit/list.volt +++ b/app/Http/Admin/Views/audit/list.volt @@ -4,14 +4,9 @@
- - 操作记录 - -
-
- - 搜索记录 - + + 操作记录 +
@@ -38,16 +33,23 @@ {% for item in pager.items %} + {% set list_by_id_url = url({'for':'admin.audit.list'},{'user_id':item.user_id}) %} + {% set list_by_ip_url = url({'for':'admin.audit.list'},{'user_ip':item.user_ip}) %} + {% set list_by_route_url = url({'for':'admin.audit.list'},{'req_route':item.req_route}) %} + {% set list_by_path_url = url({'for':'admin.audit.list'},{'req_path':item.req_path}) %} {% set show_url = url({'for':'admin.audit.show','id':item.id}) %} {{ item.user_id }} - {{ item.user_name }} - {{ item.user_ip }} - {{ item.req_route }} - {{ item.req_path }} + {{ item.user_name }} + + {{ item.user_ip }} + 位置 + + {{ item.req_route }} + {{ item.req_path }} {{ date('Y-m-d H:i:s',item.create_time) }} - - + + {% endfor %} @@ -77,12 +79,12 @@ var url = $(this).data('url'); layer.open({ type: 2, - title: '请求内容', - resize: false, + title: '数据内容', area: ['640px', '360px'], - content: [url] + content: url }); }); + }); diff --git a/app/Http/Admin/Views/audit/show.volt b/app/Http/Admin/Views/audit/show.volt index aac57fe1..85c34dae 100644 --- a/app/Http/Admin/Views/audit/show.volt +++ b/app/Http/Admin/Views/audit/show.volt @@ -2,7 +2,9 @@ {% block content %} -

+    {% set audit.req_data = audit.req_data ? audit.req_data : '{}' %}
+
+    
{{ audit.req_data }}
{% endblock %} @@ -11,10 +13,13 @@ diff --git a/app/Http/Admin/Views/carousel/list.volt b/app/Http/Admin/Views/carousel/list.volt index 47adaa8c..c60351b5 100644 --- a/app/Http/Admin/Views/carousel/list.volt +++ b/app/Http/Admin/Views/carousel/list.volt @@ -12,16 +12,13 @@ {% endif %} {%- endmacro %} + {% set add_url = url({'for':'admin.carousel.add'}) %} +
- - 轮播管理 - -
-
- - 添加轮播 - + + 轮播管理 +
@@ -49,18 +46,23 @@ {% set edit_url = url({'for':'admin.carousel.edit','id':item.id}) %} {% set update_url = url({'for':'admin.carousel.update','id':item.id}) %} {% set delete_url = url({'for':'admin.carousel.delete','id':item.id}) %} + {% set restore_url = url({'for':'admin.carousel.restore','id':item.id}) %} {{ item.id }} {{ item.title }} {{ target_info(item.target) }} - +
- +
diff --git a/app/Http/Admin/Views/category/list.volt b/app/Http/Admin/Views/category/list.volt index bd750b69..76ca10d9 100644 --- a/app/Http/Admin/Views/category/list.volt +++ b/app/Http/Admin/Views/category/list.volt @@ -2,26 +2,23 @@ {% block content %} - {% set add_category_url = url({'for':'admin.category.add'},{'type':type,'parent_id':parent.id}) %} - {% set allow_add_category = (type == 'course' and parent.level < 2) or (type == 'help' and parent.level < 1) %} + {% set back_url = url({'for':'admin.category.list'}) %} + {% set add_url = url({'for':'admin.category.add'},{'type':type,'parent_id':parent.id}) %} + {% set allow_add = (type == 'course' and parent.level < 2) or (type == 'help' and parent.level < 1) %}
- - {% if parent.id > 0 %} - - 返回 - - {{ parent.name }} - {% endif %} - 分类管理 - + + {% if parent.id > 0 %} + 返回 + {{ parent.name }} + {% endif %} + 分类管理 +
- {% if allow_add_category %} - - 添加分类 - + {% if allow_add %} + 添加分类 {% endif %}
@@ -66,9 +63,9 @@ {{ item.child_count }} - +
- +