dever %!s(int64=4) %!d(string=hai) anos
pai
achega
1c5eb54192
Modificáronse 2 ficheiros con 6 adicións e 12 borrados
  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'];