Commit e75e021a authored by chentianyu's avatar chentianyu

修复oss生产唯一文件名

parent c2faac04
......@@ -83,7 +83,7 @@ class UploadOssService
$clientFilename = $image->getClientFilename();
$fileName = $uniqueFileName ? ($this->genUniqueFileName() . '.' . $ext) : $clientFilename;
$options = ['mime' => ['jpeg', 'png', 'gif', 'jpg', 'svg']];
$filePath = 'oss2/' . $this->appDev . "/" . $this->appName . "/$module/images/" . today() . "/$userId/" . $clientFilename;
$filePath = 'oss2/' . $this->appDev . "/" . $this->appName . "/$module/images/" . today() . "/$userId/" . $fileName;
$this->upload($image, $filePath, $options);
if($this->autoSaveDataBase){
$model = new FileModel();
......@@ -118,7 +118,7 @@ class UploadOssService
$ext = $file->getExtension();
$clientFilename = $file->getClientFilename();
$fileName = $uniqueFileName ? ($this->genUniqueFileName() . '.' . $ext) : $clientFilename;
$filePath = 'oss2/' . $this->appDev . "/" . $this->appName . "/$module/files/" . today() . "/$userId/" . $clientFilename;
$filePath = 'oss2/' . $this->appDev . "/" . $this->appName . "/$module/files/" . today() . "/$userId/" . $fileName;
$this->upload($file, $filePath, $options);
if($this->autoSaveDataBase){
$model = new FileModel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment