This commit is contained in:
2026-01-02 04:51:16 +08:00
parent 168954e4c4
commit eeb348c053
+4 -2
View File
@@ -702,7 +702,9 @@ if (!function_exists('storage')) {
*/ */
function storage(?string $fileName = '', ?string $path = ''): string function storage(?string $fileName = '', ?string $path = ''): string
{ {
if (!str_ends_with($path, '/')) {
$path .= '/';
}
$basePath = rtrim(Kiri::getStoragePath(), '/'); $basePath = rtrim(Kiri::getStoragePath(), '/');
if (!empty($path)) { if (!empty($path)) {
$path = ltrim($path, '/'); $path = ltrim($path, '/');
@@ -1010,7 +1012,7 @@ if (!function_exists('json_log')) {
]; ];
$param['data'] = $data; $param['data'] = $data;
file_put_contents(storage('/exception-' . date('Y-m-d') . '.log','exception'), file_put_contents(storage('exception-' . date('Y-m-d') . '.log','exception'),
json_encode($param, JSON_UNESCAPED_UNICODE), json_encode($param, JSON_UNESCAPED_UNICODE),
FILE_APPEND); FILE_APPEND);
} }