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

+ 3 - 6
lib/Store/Oss.php

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

+ 3 - 6
lib/Store/Qiniu.php

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