dever 4 rokov pred
rodič
commit
ae2227033a
3 zmenil súbory, kde vykonal 13 pridanie a 7 odobranie
  1. 1 5
      lib/Store/Core.php
  2. 6 1
      lib/Store/Oss.php
  3. 6 1
      lib/Store/Qiniu.php

+ 1 - 5
lib/Store/Core.php

@@ -274,11 +274,7 @@ class Core
 				$this->limit = array($this->data['param']['param_w'], $this->data['param']['param_h']);
 				if (isset($this->data['name'])) {
 					$param = implode('_', array_values($this->data['param']));
-					$this->data['file']['name'] .= '.' . $this->data['name'] . $param;
-					
-					$temp = explode('/', $this->data['file']['name']);
-					$count = count($temp) - 1;
-					$this->data['file']['name'] = $temp[$count];
+					$this->data['file']['name'] = '.' . $this->data['name'] . $param;
 					if ($this->base64) {
 						$this->data['name'] = $this->data['file']['name'];
 					} else {

+ 6 - 1
lib/Store/Oss.php

@@ -48,7 +48,12 @@ class Oss extends Core implements Config
 
     public function file()
     {
-        $this->file = $this->path . $this->name . $this->ext;
+        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;

+ 6 - 1
lib/Store/Qiniu.php

@@ -50,7 +50,12 @@ class Qiniu extends Core implements Config
 
     public function file()
     {
-        $this->file = $this->path . $this->name . $this->ext;
+        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;