From 5404c82201af8d1ba9c300abb125bf2aeb1c3e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=81=E9=BE=8D?= <695798354@qq.com> Date: Thu, 12 Aug 2021 07:51:39 +0000 Subject: [PATCH] update application/common/library/Upload.php. --- application/common/library/Upload.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/application/common/library/Upload.php b/application/common/library/Upload.php index 66afc1dc8..6c7eb62b5 100644 --- a/application/common/library/Upload.php +++ b/application/common/library/Upload.php @@ -36,6 +36,13 @@ class Upload protected $error = ''; + /** + * 保存文件的跟地址 + * + * @var string + */ + protected $saveRootPath = ROOT_PATH . 'public'; + /** * @var \think\File */ @@ -380,6 +387,17 @@ class Upload return $attachment; } + /** + * 设置保存文件的根地址 + * + * @param string $path + * @return self + */ + public function setSaveRootPath($path) { + $this->saveRootPath = $path; + return $this; + } + public function setError($msg) { $this->error = $msg; -- Gitee