diff --git a/App/HttpController/Api/Auths.php b/App/HttpController/Api/Auths.php index 2bf1321..3e1917e 100755 --- a/App/HttpController/Api/Auths.php +++ b/App/HttpController/Api/Auths.php @@ -143,7 +143,8 @@ public function update() public function getOne() { $param = $this->request()->getRequestParam(); - $model = new AuthModel(); + + $model = new AuthModel(); $bean = $model->get(['auth_id' => $param['auth_id']]); if ($bean) { $this->writeJson(Status::CODE_OK, $bean, "success"); diff --git a/App/HttpController/Common/Services/MenuService.php b/App/HttpController/Common/Services/MenuService.php index d33fa3d..ceeabe0 100755 --- a/App/HttpController/Common/Services/MenuService.php +++ b/App/HttpController/Common/Services/MenuService.php @@ -2,6 +2,7 @@ namespace App\HttpController\Common\Services; +use App\Model\AuthModel; use App\Model\SystemModel; use App\Model\UserModel; @@ -58,6 +59,11 @@ private function makeTree($child) } } $tem = $this->auth_list[$value['id']]; + + if ($tem instanceof AuthModel) { + $tem = $tem->toArray(); + } + if ( isset($value['child'] ) ){ // unset($tem['auth_rules']); $tem['childs'] = $this->makeTree($value['child']); diff --git a/README.md b/README.md index bb62b05..3769a7b 100755 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ``` 1.下载源码,可以是clone也可以是下载打了tag的源码 2.安装composer依赖 composer install或composer update -3.安装easyswoole ./vendor/bin/eayswoole install +3.安装easyswoole ./vendor/bin/easyswoole install 4.编辑数据库配置 dev.php 5.运行数据库迁移 ./vendor/bin/phinx migrate 6.编辑前端public/nepadmin/config.js搜索 requestUrl 请求url换成你自己的es服务地址 IP:Port diff --git a/dev.php b/dev.php index 8c9a37e..6a6c0ad 100755 --- a/dev.php +++ b/dev.php @@ -38,9 +38,9 @@ 'MYSQL' => [ //数据库配置 'host' => '127.0.0.1',//数据库连接ip - 'user' => 'newadmin',//数据库用户名 - 'password' => 'RdkfmTScjJPpHx4k',//数据库密码 - 'database' => 'newadmin',//数据库 + 'user' => 'root',//数据库用户名 + 'password' => '123456',//数据库密码 + 'database' => 'redbase',//数据库 'port' => '3306',//端口 'timeout' => '30',//超时时间 'connect_timeout' => '5',//连接超时时间 diff --git a/public/nepadmin/config.js b/public/nepadmin/config.js index c03a0b9..9a2ba08 100755 --- a/public/nepadmin/config.js +++ b/public/nepadmin/config.js @@ -35,7 +35,7 @@ layui.define(function(exports) { }, //request 基础URL 如 http://192.168.23.133:9501/api/ - requestUrl: 'http://192.168.23.133:9501/api/', + requestUrl: 'http://127.0.0.1:9501/api/', //独立页面路由,可随意添加(无需写参数) indPage: [ '/user/login', //登入页 diff --git a/public/nepadmin/lay/modules/admin.js b/public/nepadmin/lay/modules/admin.js index d8af5b3..0ec7550 100755 --- a/public/nepadmin/lay/modules/admin.js +++ b/public/nepadmin/lay/modules/admin.js @@ -241,6 +241,13 @@ layui str ) } + self.popupClose = function(index) { + if (Number(index) > 0) { + layer.close(index); + } else { + layer.closeAll(); + } + } self.popup = function(params) { var url = params.url || '' var success = params.success || function() {} diff --git a/public/nepadmin/lay/modules/api.js b/public/nepadmin/lay/modules/api.js index 6bb9e2b..ec91345 100755 --- a/public/nepadmin/lay/modules/api.js +++ b/public/nepadmin/lay/modules/api.js @@ -10,6 +10,8 @@ layui.define([], function (exports) { getAuthList: 'auths/get_tree_list', saveAuthList: 'auths/save_tree_list', addAuth: 'auths/add', + deleteAuth: 'auths/delete', + updateAuth: 'auths/update', getAllAuth: 'auths/getAll', // 角色管理 diff --git a/public/nepadmin/lay/modules/view.js b/public/nepadmin/lay/modules/view.js index fc35e61..3091dfc 100755 --- a/public/nepadmin/lay/modules/view.js +++ b/public/nepadmin/lay/modules/view.js @@ -478,7 +478,6 @@ layui params.url = conf.requestUrl + params.url } - var defaultParams = { timeout: 5000, type: 'get', @@ -492,16 +491,22 @@ layui layui.admin.logout() }) } else { - // self.log( - // '返回状态码异常:' + - // res[conf.response.statusName] + - // '\n请求URL:' + - // params.url - // ); - layer.alert('返回状态码异常:' +res[conf.response.statusName] + "
" + res[conf.response.msgName]); + if ($.isFunction(success)) { + success(res) + } else { + // self.log( + // '返回状态码异常:' + + // res[conf.response.statusName] + + // '\n请求URL:' + + // params.url + // ); + + layer.alert('返回状态码异常:' +res[conf.response.statusName] + "
" + res[conf.response.msgName]); + } return false; } } + if ($.isFunction(success)) success(res) }, error: function(res) { @@ -526,6 +531,8 @@ layui var token = layui.admin.getLoginToken() if (token) defaultParams.headers[conf.tokenName] = token } + + delete params.success delete params.error diff --git a/public/nepadmin/views/auths/list.html b/public/nepadmin/views/auths/list.html index 93e0ed3..2335029 100755 --- a/public/nepadmin/views/auths/list.html +++ b/public/nepadmin/views/auths/list.html @@ -28,49 +28,46 @@ margin:0; padding:0; min-height:20px; - font-size:13px; + font-size:14px; line-height:20px; } .dd-handle { display:block; height:30px; margin:5px 0; - padding:5px 10px; + padding:5px; color:#333; text-decoration:none; - font-weight:bold; - border:1px solid #ccc; + /*font-weight:bold;*/ background:#f2f2f2; - -webkit-border-radius:3px; - border-radius:3px; box-sizing:border-box; -moz-box-sizing:border-box; } .dd-handle:hover { - color:#2ea8e5; - background:#fff; + color:#fff; + background:#5a8bff; + cursor: pointer; } .dd-item > button { - display:block; - position:relative; - cursor:pointer; - float:left; - width:25px; - height:20px; - margin:5px 0; - padding:0; - text-indent:100%; - white-space:nowrap; - overflow:hidden; - border:0; - background:transparent; - font-size:12px; - line-height:1; - text-align:center; - font-weight:bold; + display: block; + position: relative; + cursor: pointer; + float: left; + width: 30px; + height: 30px; + padding: 0; + text-indent: 100%; + white-space: nowrap; + overflow: hidden; + border: 0; + font-size: 23px; + color: #fff; + line-height: 0px; + text-align: center; + background-color: #5a8bff; } .dd-item > button:before { - content:'+'; + content:'+'; display:block; position:absolute; width:100%; @@ -78,7 +75,7 @@ text-indent:0; } .dd-item > button[data-action="collapse"]:before { - content:'-'; + content:'-'; } .dd-placeholder,.dd-empty { margin:5px 0; @@ -111,6 +108,22 @@ -webkit-box-shadow:2px 4px 6px 0 rgba(0,0,0,.1); box-shadow:2px 4px 6px 0 rgba(0,0,0,.1); } + .dd-icon { + margin: 0px 3px 0px 5px; + } + .dd-btn-box { + position: absolute; + float: right; + right: 5px; + top: 4px; + } + .btn-del { + margin-left: 0px !important; + } + + .opt-icon { + font-size: 30px !important; + }
@@ -132,9 +145,14 @@ class="layui-input">
- + + +
+
@@ -148,29 +166,6 @@
- - -
-
-
权限排序
-
-

- - 排序决定菜单类型权限显示,其他只为分类好区分 - -

-
-
-
-
-
- - - - -
- -
查看缓存
@@ -183,10 +178,6 @@
-
- - -
清空缓存
@@ -196,58 +187,35 @@
+
+
+
权限排序 + 排序决定菜单类型权限显示,其他只为分类好区分
+
+
+ + + + + +
+
+
+
+
+
- - + +