dever 4 年之前
父節點
當前提交
eb04bce512
共有 2 個文件被更改,包括 4 次插入6 次删除
  1. 2 3
      lib/Store/Oss.php
  2. 2 3
      lib/Store/Qiniu.php

+ 2 - 3
lib/Store/Oss.php

@@ -50,10 +50,9 @@ class Oss extends Core implements Config
     {
         if ($this->base64 && isset($this->data['local'])) {
             $data = parse_url($this->data['local']);
-            $this->file = $data['path'] . $this->name . $this->ext;
-        } else {
-            $this->file = $this->path . $this->name . $this->ext;
+            $this->path = ltrim($data['path'], '/');
         }
+        $this->file = $this->path . $this->name . $this->ext;
 
         $this->output['file'] = $this->file;
         $this->output['url'] = $this->host . $this->file;

+ 2 - 3
lib/Store/Qiniu.php

@@ -52,10 +52,9 @@ class Qiniu extends Core implements Config
     {
         if ($this->base64 && isset($this->data['local'])) {
             $data = parse_url($this->data['local']);
-            $this->file = $data['path'] . $this->name . $this->ext;
-        } else {
-            $this->file = $this->path . $this->name . $this->ext;
+            $this->path = ltrim($data['path'], '/');
         }
+        $this->file = $this->path . $this->name . $this->ext;
 
         $this->output['file'] = $this->file;
         $this->output['url'] = $this->host . $this->file;