dever 4 年之前
父节点
当前提交
bce235ff4a
共有 2 个文件被更改,包括 12 次插入4 次删除
  1. 6 2
      lib/Store/Oss.php
  2. 6 2
      lib/Store/Qiniu.php

+ 6 - 2
lib/Store/Oss.php

@@ -49,14 +49,18 @@ class Oss extends Core implements Config
     public function file()
     {
         if ($this->base64 && isset($this->data['local'])) {
-            $this->data['local'] = str_replace(Dever::data() . 'upload/', '', $this->data['local']);
             $this->file = $this->data['local'] . $this->name . $this->ext;
         } else {
             $this->file = $this->path . $this->name . $this->ext;
         }
 
         $this->output['file'] = $this->file;
-        $this->output['url'] = $this->host . $this->file;
+        if (strstr($this->file, 'http')) {
+            $this->output['url'] = $this->file;
+        } else {
+            $this->output['url'] = $this->host . $this->file;
+        }
+        
         //$this->output['url'] = '{uploadYun}' . $this->file;
         return $this->output['file'];
     }

+ 6 - 2
lib/Store/Qiniu.php

@@ -51,14 +51,18 @@ class Qiniu extends Core implements Config
     public function file()
     {
         if ($this->base64 && isset($this->data['local'])) {
-            $this->data['local'] = str_replace(Dever::data() . 'upload/', '', $this->data['local']);
             $this->file = $this->data['local'] . $this->name . $this->ext;
         } else {
             $this->file = $this->path . $this->name . $this->ext;
         }
 
         $this->output['file'] = $this->file;
-        $this->output['url'] = $this->host . $this->file;
+        if (strstr($this->file, 'http')) {
+            $this->output['url'] = $this->file;
+        } else {
+            $this->output['url'] = $this->host . $this->file;
+        }
+        
         //$this->output['url'] = '{uploadYun}' . $this->file;
         return $this->output['file'];
     }