Merge branch 'develop' into feature/user0812

This commit is contained in:
2025-08-14 11:15:42 +08:00
3 changed files with 14 additions and 7 deletions
+7 -3
View File
@@ -23,12 +23,16 @@ class PermLogic
}
$all = collect();
// 合并角色资源,排除不需要权限认证的资源
// 遍历用户的所有角色,合并每个角色所拥有的资源
foreach ($user->roles as $role) {
$all = $all->merge(
// 过滤当前角色的资源列表
$role->resources->filter(function ($resource) use($system) {
// 只保留需要权限认证的资源(或公共资源)
// 资源过滤条件:
// 1. !$resource->no_auth:资源需要权限认证(排除公共资源)
// 2. 系统匹配条件:
// - $system->id == $resource->system_id:资源属于当前系统
// - $resource->system_id == 0:资源为全局公共资源(所有系统可用)
return !$resource->no_auth && ($system->id == $resource->system_id || $resource->system_id == 0);
})
);
+5 -2
View File
@@ -156,8 +156,11 @@ class Generate
protected function deleteFileIfExists($path)
{
if (file_exists($path)) {
unlink($path);
echo "删除已存在文件: <comment>{$path}</comment> \n";
"文件: <comment>{$path}</comment> 已存在,核对后手动删除。\n";
return;
// unlink($path);
// echo "删除已存在文件: <comment>{$path}</comment> \n";
}
}