webman迁移-优化curd

This commit is contained in:
2026-03-18 15:24:32 +08:00
parent e2ae55319e
commit a64d157388
4 changed files with 31 additions and 11 deletions

View File

@@ -377,11 +377,16 @@ if (!function_exists('parse_name')) {
if (!function_exists('root_path')) {
/**
* 根路径BuildAdmin 兼容,等价于 base_path
* 无参数时返回带尾部分隔符的路径,确保 root_path() . 'app' 拼接正确
* @param string $path 子路径
*/
function root_path(string $path = ''): string
{
return base_path($path);
$base = base_path($path);
if ($path === '' && $base !== '') {
return rtrim($base, DIRECTORY_SEPARATOR . '/') . DIRECTORY_SEPARATOR;
}
return $base;
}
}