This commit is contained in:
mkm 2023-11-09 14:09:52 +08:00
parent e6b3cf8736
commit a05b316e02
4365 changed files with 47 additions and 3 deletions

0
.example.env Normal file → Executable file
View File

0
.gitignore vendored Normal file → Executable file
View File

0
.travis.yml Normal file → Executable file
View File

0
LICENSE.txt Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
app/.htaccess Normal file → Executable file
View File

0
app/AppService.php Normal file → Executable file
View File

0
app/BaseController.php Normal file → Executable file
View File

0
app/ExceptionHandle.php Normal file → Executable file
View File

0
app/Request.php Normal file → Executable file
View File

0
app/adminapi/config/route.php Normal file → Executable file
View File

0
app/adminapi/controller/BaseAdminController.php Normal file → Executable file
View File

0
app/adminapi/controller/ConfigController.php Normal file → Executable file
View File

0
app/adminapi/controller/DownloadController.php Normal file → Executable file
View File

0
app/adminapi/controller/FileController.php Normal file → Executable file
View File

0
app/adminapi/controller/LoginController.php Normal file → Executable file
View File

0
app/adminapi/controller/UploadController.php Normal file → Executable file
View File

0
app/adminapi/controller/WorkbenchController.php Normal file → Executable file
View File

View File

0
app/adminapi/controller/article/ArticleController.php Normal file → Executable file
View File

0
app/adminapi/controller/auth/AdminController.php Normal file → Executable file
View File

0
app/adminapi/controller/auth/MenuController.php Normal file → Executable file
View File

0
app/adminapi/controller/auth/RoleController.php Normal file → Executable file
View File

View File

View File

View File

View File

0
app/adminapi/controller/crontab/CrontabController.php Normal file → Executable file
View File

0
app/adminapi/controller/dept/DeptController.php Normal file → Executable file
View File

0
app/adminapi/controller/dept/JobsController.php Normal file → Executable file
View File

0
app/adminapi/controller/notice/NoticeController.php Normal file → Executable file
View File

0
app/adminapi/controller/notice/SmsConfigController.php Normal file → Executable file
View File

View File

0
app/adminapi/controller/setting/StorageController.php Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

View File

0
app/adminapi/controller/tools/GeneratorController.php Normal file → Executable file
View File

0
app/adminapi/controller/user/UserController.php Normal file → Executable file
View File

0
app/adminapi/event.php Normal file → Executable file
View File

0
app/adminapi/http/middleware/AuthMiddleware.php Normal file → Executable file
View File

0
app/adminapi/http/middleware/CheckDemoMiddleware.php Normal file → Executable file
View File

View File

0
app/adminapi/http/middleware/InitMiddleware.php Normal file → Executable file
View File

0
app/adminapi/http/middleware/LoginMiddleware.php Normal file → Executable file
View File

0
app/adminapi/listener/OperationLog.php Normal file → Executable file
View File

0
app/adminapi/lists/BaseAdminDataLists.php Normal file → Executable file
View File

0
app/adminapi/lists/article/ArticleCateLists.php Normal file → Executable file
View File

0
app/adminapi/lists/article/ArticleLists.php Normal file → Executable file
View File

0
app/adminapi/lists/auth/AdminLists.php Normal file → Executable file
View File

0
app/adminapi/lists/auth/MenuLists.php Normal file → Executable file
View File

0
app/adminapi/lists/auth/RoleLists.php Normal file → Executable file
View File

View File

0
app/adminapi/lists/crontab/CrontabLists.php Normal file → Executable file
View File

0
app/adminapi/lists/decorate/MenuLists.php Normal file → Executable file
View File

0
app/adminapi/lists/dept/JobsLists.php Normal file → Executable file
View File

0
app/adminapi/lists/file/FileCateLists.php Normal file → Executable file
View File

0
app/adminapi/lists/file/FileLists.php Normal file → Executable file
View File

0
app/adminapi/lists/notice/NoticeSettingLists.php Normal file → Executable file
View File

0
app/adminapi/lists/setting/dict/DictDataLists.php Normal file → Executable file
View File

0
app/adminapi/lists/setting/dict/DictTypeLists.php Normal file → Executable file
View File

0
app/adminapi/lists/setting/system/LogLists.php Normal file → Executable file
View File

0
app/adminapi/lists/tools/DataTableLists.php Normal file → Executable file
View File

0
app/adminapi/lists/tools/GenerateTableLists.php Normal file → Executable file
View File

0
app/adminapi/lists/user/UserLists.php Normal file → Executable file
View File

0
app/adminapi/logic/ConfigLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/FileLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/LoginLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/WorkbenchLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/article/ArticleCateLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/article/ArticleLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/auth/AdminLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/auth/AuthLogic.php Normal file → Executable file
View File

32
app/adminapi/logic/auth/MenuLogic.php Normal file → Executable file
View File

@ -50,8 +50,10 @@ class MenuLogic extends BaseLogic
$where[] = ['is_disable', '=', 0];
if ($admin['root'] != 1) {
$roleMenu = SystemRoleMenu::whereIn('role_id', $admin['role_id'])->column('menu_id');
$roleMenu = SystemRoleMenu::whereIn('role_id', $admin['role_id'])->where('is_top', 1)->column('menu_id');
$where[] = ['id', 'in', $roleMenu];
} else {
$where[] = ['pid', '=', 0];
}
$menu = SystemMenu::where($where)
@ -61,6 +63,16 @@ class MenuLogic extends BaseLogic
return linear_to_tree($menu, 'children');
}
// public static function getPidMyList($pid){
// $where = [];
// $where[] = ['type', 'in', ['M', 'C']];
// $where[] = ['is_disable', '=', 0];
// $where[] = ['pid', '=', $pid];
// $menu = SystemMenu::where($where)
// ->order(['sort' => 'desc', 'id' => 'asc'])
// ->select();
// }
/**
* @notes 添加菜单
@ -98,9 +110,24 @@ class MenuLogic extends BaseLogic
*/
public static function edit(array $params)
{
$is_pid = true;
$pid=$params['pid'];
$model_name='';
if ($pid > 0) {
while ($is_pid==true) {
$find= SystemMenu::where('id', $pid)->field('id,pid,paths')->find();
if($find['pid']==0){
$is_pid=false;
$model_name=$find['paths'];
}else{
$pid=$find['pid'];
}
}
}
return SystemMenu::update([
'id' => $params['id'],
'pid' => $params['pid'],
'model_name' => $model_name,
'type' => $params['type'],
'name' => $params['name'],
'icon' => $params['icon'] ?? '',
@ -180,5 +207,4 @@ class MenuLogic extends BaseLogic
return linear_to_tree($data, 'children');
}
}
}

18
app/adminapi/logic/auth/RoleLogic.php Normal file → Executable file
View File

@ -43,6 +43,7 @@ class RoleLogic extends BaseLogic
Db::startTrans();
try {
$menuId = !empty($params['menu_id']) ? $params['menu_id'] : [];
$top_arr = !empty($params['top_arr']) ? $params['top_arr'] : [];
$role = SystemRole::create([
'name' => $params['name'],
@ -55,9 +56,17 @@ class RoleLogic extends BaseLogic
if (empty($item)) {
continue;
}
$is_top=0;
foreach ($top_arr as $top){
if($top==$item){
$is_top=1;
break;
}
}
$data[] = [
'role_id' => $role['id'],
'menu_id' => $item,
'is_top' =>$is_top
];
}
(new SystemRoleMenu)->insertAll($data);
@ -84,6 +93,7 @@ class RoleLogic extends BaseLogic
Db::startTrans();
try {
$menuId = !empty($params['menu_id']) ? $params['menu_id'] : [];
$top_arr = !empty($params['top_arr']) ? $params['top_arr'] : [];
SystemRole::update([
'id' => $params['id'],
@ -96,9 +106,17 @@ class RoleLogic extends BaseLogic
SystemRoleMenu::where(['role_id' => $params['id']])->delete();
$data = [];
foreach ($menuId as $item) {
$is_top=0;
foreach ($top_arr as $top){
if($top==$item){
$is_top=1;
break;
}
}
$data[] = [
'role_id' => $params['id'],
'menu_id' => $item,
'is_top' => $is_top
];
}
(new SystemRoleMenu)->insertAll($data);

0
app/adminapi/logic/channel/AppSettingLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/channel/MnpSettingsLogic.php Normal file → Executable file
View File

View File

View File

View File

0
app/adminapi/logic/channel/OpenSettingLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/channel/WebPageSettingLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/crontab/CrontabLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/decorate/DecorateDataLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/decorate/DecoratePageLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/decorate/DecorateTabbarLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/dept/DeptLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/dept/JobsLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/notice/NoticeLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/notice/SmsConfigLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/setting/CustomerServiceLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/setting/StorageLogic.php Normal file → Executable file
View File

View File

0
app/adminapi/logic/setting/dict/DictDataLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/setting/dict/DictTypeLogic.php Normal file → Executable file
View File

0
app/adminapi/logic/setting/system/CacheLogic.php Normal file → Executable file
View File

Some files were not shown because too many files have changed in this diff Show More