chore(src): 针对上传权限,提供更多有价值的信息

This commit is contained in:
2025-12-02 17:07:35 +08:00
parent eb79ad260c
commit c161bc55e5

View File

@@ -890,11 +890,13 @@ class Upload extends BaseModel
*/ */
public function checkPath($path) public function checkPath($path)
{ {
try {
if (file_exists($path) || mkdir($path, 0755, true)) { if (file_exists($path) || mkdir($path, 0755, true)) {
return $this->success(); return $this->success();
} }
} catch (\Exception $e) {
return $this->error('', "上传目录 {$path} 创建失败,请检测权限"); return $this->error('', "上传目录 {$path} 创建失败,请检测权限:" . $e->getMessage());
}
} }
/** /**