From 7530c06b6aabd658bde57f6bf7e7ed80e3dc8502 Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 27 Sep 2017 16:22:16 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=AD=A3=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=90=8E=E7=BC=80=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0=E5=90=8E=E5=8F=B0?= =?UTF-8?q?UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Auth.php | 11 +- application/admin/controller/Config.php | 2 +- application/admin/controller/Index.php | 2 +- application/admin/controller/Log.php | 2 +- application/admin/controller/Menu.php | 2 +- application/admin/controller/Plugs.php | 1 + application/admin/controller/User.php | 6 +- application/admin/view/auth.index.html | 124 ++- application/admin/view/log.index.html | 114 ++- application/admin/view/login.index.html | 12 +- application/admin/view/menu.index.html | 117 ++- application/admin/view/plugs.upfile.html | 1074 +++++++++++----------- application/admin/view/user.index.html | 157 ++-- 13 files changed, 803 insertions(+), 821 deletions(-) diff --git a/application/admin/controller/Auth.php b/application/admin/controller/Auth.php index 7ad0df9e6..dfc6d114d 100644 --- a/application/admin/controller/Auth.php +++ b/application/admin/controller/Auth.php @@ -70,9 +70,12 @@ class Auth extends BasicAdmin $checked = Db::name('SystemAuthNode')->where(['auth' => $auth_id])->column('node'); foreach ($nodes as $key => &$node) { $node['checked'] = in_array($node['node'], $checked); + if (empty($node['is_auth']) && substr_count($node['node'], '/') > 1) { + unset($nodes[$key]); + } } - $all = $this->_apply_filter(ToolsService::arr2tree($nodes, 'node', 'pnode', '_sub_')); - $this->success('获取节点成功!', '', $all); + $allnode = $this->_apply_filter(ToolsService::arr2tree($nodes, 'node', 'pnode', '_sub_')); + $this->success('获取节点成功!', '', $allnode); } /** @@ -101,6 +104,8 @@ class Auth extends BasicAdmin foreach ($nodes as $key => &$node) { if (!empty($node['_sub_']) && is_array($node['_sub_'])) { $node['_sub_'] = $this->_apply_filter($node['_sub_'], $level + 1); + } elseif ($level < 3) { + unset($nodes[$key]); } } return $nodes; @@ -151,7 +156,7 @@ class Auth extends BasicAdmin { if (DataService::update($this->table)) { $id = $this->request->post('id'); - Db::name('SystemAuthNode')->where(['auth' => $id])->delete(); + Db::name('SystemAuthNode')->where('auth', $id)->delete(); $this->success("权限删除成功!", ''); } $this->error("权限删除失败,请稍候再试!"); diff --git a/application/admin/controller/Config.php b/application/admin/controller/Config.php index 155ffc1b3..258612f79 100644 --- a/application/admin/controller/Config.php +++ b/application/admin/controller/Config.php @@ -60,7 +60,7 @@ class Config extends BasicAdmin public function file() { $this->title = '文件存储配置'; - $alert = ['type' => 'success', 'title' => '操作提示', 'content' => '文件引擎参数影响全局文件上传功能,请勿随意修改!']; + $alert = ['type' => 'success', 'title' => '操作提示', 'content' => '文件引擎参数影响全局文件上传功能,请勿随意修改!']; $this->assign('alert', $alert); return $this->index(); } diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index 65484ba9f..d490a2b50 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -63,7 +63,7 @@ class Index extends BasicAdmin continue; // 菜单链接不为空时,判断登录状态及权限验证 elseif ($menu['url'] !== '#') : - $node = join('/', array_slice(explode('/', preg_replace('/[\W]/', '/', $menu['url'])), 0, 3)); + $node = join('/', array_slice(explode('/', preg_replace('/[\W^_]/', '/', $menu['url'])), 0, 3)); $menu['url'] = url($menu['url']); // 节点需要验证验证,未登录时移除此菜单 if (isset($nodes[$node]) && $nodes[$node]['is_login'] && !session('user')) : diff --git a/application/admin/controller/Log.php b/application/admin/controller/Log.php index f9e77cd6b..beff34267 100644 --- a/application/admin/controller/Log.php +++ b/application/admin/controller/Log.php @@ -20,7 +20,7 @@ use think\Db; /** * 系统日志管理 - * Class Log + * Class User * @package app\admin\controller * @author Anyon * @date 2017/02/15 18:12 diff --git a/application/admin/controller/Menu.php b/application/admin/controller/Menu.php index 46f7078fe..5cf64ef73 100644 --- a/application/admin/controller/Menu.php +++ b/application/admin/controller/Menu.php @@ -83,7 +83,7 @@ class Menu extends BasicAdmin { if ($this->request->isGet()) { // 上级菜单处理 - $_menus = Db::name($this->table)->where(['status' => '1'])->order('sort asc,id asc')->select(); + $_menus = Db::name($this->table)->where('status', '1')->order('sort desc,id desc')->select(); $_menus[] = ['title' => '顶级菜单', 'id' => '0', 'pid' => '-1']; $menus = ToolsService::arr2table($_menus); foreach ($menus as $key => &$menu) { diff --git a/application/admin/controller/Plugs.php b/application/admin/controller/Plugs.php index acfd213d5..83abdc575 100644 --- a/application/admin/controller/Plugs.php +++ b/application/admin/controller/Plugs.php @@ -16,6 +16,7 @@ namespace app\admin\controller; use controller\BasicAdmin; use service\FileService; +use think\Db; /** * 插件助手控制器 diff --git a/application/admin/controller/User.php b/application/admin/controller/User.php index 09045dcd0..4f23b666e 100644 --- a/application/admin/controller/User.php +++ b/application/admin/controller/User.php @@ -41,7 +41,7 @@ class User extends BasicAdmin { $this->title = '系统用户管理'; $get = $this->request->get(); - $db = Db::name($this->table)->where(['is_deleted' => '0']); + $db = Db::name($this->table)->where(['is_deleted' => '0', 'type' => '系统用户']); foreach (['username', 'phone'] as $key) { if (isset($get[$key]) && $get[$key] !== '') { $db->where($key, 'like', "%{$get[$key]}%"); @@ -64,7 +64,7 @@ class User extends BasicAdmin */ public function add() { - return $this->_form($this->table, 'form'); + return $this->_form($this->table, 'form', 'id', [], ['type' => '系统用户']); } /** @@ -72,7 +72,7 @@ class User extends BasicAdmin */ public function edit() { - return $this->_form($this->table, 'form'); + return $this->_form($this->table, 'form', 'id', [], ['type' => '系统用户']); } /** diff --git a/application/admin/view/auth.index.html b/application/admin/view/auth.index.html index d23682d55..3189c6c90 100644 --- a/application/admin/view/auth.index.html +++ b/application/admin/view/auth.index.html @@ -2,89 +2,81 @@ {block name="button"}
- - + +
{/block} {block name="content"}
- {if empty($list)} -

没 有 记 录 哦!

- {else} + {if !empty($list)} - +
- - - - - - - - + + + + + + + + - {foreach $list as $key=>$vo} - - - - - - - + + + + + + - - {/foreach} + + + {/foreach}
- - - - 权限名称权限描述状态操作
+ + + + 权限名称权限描述状态操作
- - - - {$vo.title}{$vo.desc|default="没有写描述哦!"} - {if $vo.status eq 0} - 已禁用 - {elseif $vo.status eq 1} - 使用中 - {/if} - + {foreach $list as $key=>$vo} +
+ + + + {$vo.title}{$vo.desc|default="没有写描述哦!"} + {if $vo.status eq 0} + 已禁用 + {elseif $vo.status eq 1} + 使用中 + {/if} + - {if auth("$classuri/edit")} - | - 编辑 - {/if} + {if auth("$classuri/edit")} + | + 编辑 + {/if} - {if auth("$classuri/apply")} - | - 授权 - {/if} + {if auth("$classuri/apply")} + | + 授权 + {/if} - {if $vo.status eq 1 and auth("$classuri/forbid")} - | - 禁用 - {elseif auth("$classuri/resume")} - | - 启用 - {/if} + {if $vo.status eq 1 and auth("$classuri/forbid")} + | + 禁用 + {elseif auth("$classuri/resume")} + | + 启用 + {/if} - {if auth("$classuri/del")} - | - 删除 - {/if} + {if auth("$classuri/del")} + | + 删除 + {/if} -
{if isset($page)}

{$page}

{/if} + {else} +

暂时无记录

{/if}
{/block} \ No newline at end of file diff --git a/application/admin/view/log.index.html b/application/admin/view/log.index.html index a18e3ab66..9b48798a5 100644 --- a/application/admin/view/log.index.html +++ b/application/admin/view/log.index.html @@ -3,8 +3,7 @@ {block name="button"}
{if auth("$classuri/del")} - {/if} @@ -14,78 +13,77 @@ {block name="content"} -