From e4040a27e736af4b6650d09cc9fe8caa4775803e Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Tue, 2 Dec 2025 17:31:37 +0800 Subject: [PATCH] =?UTF-8?q?chore(src):=20=E8=BF=98=E5=8E=9Fsrc\app\model\u?= =?UTF-8?q?pload\Upload.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/model/upload/Upload.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/app/model/upload/Upload.php b/src/app/model/upload/Upload.php index 614581967..f8d3903cb 100644 --- a/src/app/model/upload/Upload.php +++ b/src/app/model/upload/Upload.php @@ -890,24 +890,12 @@ class Upload extends BaseModel */ public function checkPath($path) { - $current_user = get_current_user(); - $current_user = $current_user ? $current_user : 'unknown'; - $current_work_dir = getcwd(); - $current_work_dir = $current_work_dir ? $current_work_dir : 'unknown'; - // 如果$path不是以工作目录开头,需要添加工作目录 - $absolute_path = $path; - if (!strpos($path, $current_work_dir)) { - $absolute_path = $current_work_dir . "/" . $path; - } - try { - - if (file_exists($absolute_path) || mkdir($absolute_path, 0755, true)) { + if (file_exists($path) || mkdir($path, 0755, true)) { return $this->success(); } } catch (\Exception $e) { - - return $this->error('', "上传目录 {$absolute_path} 创建失败,请检测权限:用户{$current_user},当前工作目录{$current_work_dir}," . $e->getMessage()); + return $this->error('', "上传目录 {$path} 创建失败,请检测权限:" . $e->getMessage()); } }