Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icon图标选择 #19

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion App/HttpController/Api/Auths.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 6 additions & 0 deletions App/HttpController/Common/Services/MenuService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\HttpController\Common\Services;

use App\Model\AuthModel;
use App\Model\SystemModel;
use App\Model\UserModel;

Expand Down Expand Up @@ -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']);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',//连接超时时间
Expand Down
2 changes: 1 addition & 1 deletion public/nepadmin/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', //登入页
Expand Down
7 changes: 7 additions & 0 deletions public/nepadmin/lay/modules/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand Down
2 changes: 2 additions & 0 deletions public/nepadmin/lay/modules/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',

// 角色管理
Expand Down
23 changes: 15 additions & 8 deletions public/nepadmin/lay/modules/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ layui
params.url = conf.requestUrl + params.url
}


var defaultParams = {
timeout: 5000,
type: 'get',
Expand All @@ -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] + "<br/>" + 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] + "<br/>" + res[conf.response.msgName]);
}
return false;
}
}

if ($.isFunction(success)) success(res)
},
error: function(res) {
Expand All @@ -526,6 +531,8 @@ layui
var token = layui.admin.getLoginToken()
if (token) defaultParams.headers[conf.tokenName] = token
}


delete params.success
delete params.error

Expand Down
Loading