dever 6 年之前
父節點
當前提交
230c0905fd
共有 4 個文件被更改,包括 14 次插入6 次删除
  1. 1 1
      src/Store/Handle.php
  2. 8 0
      src/Store/Local.php
  3. 1 2
      src/Store/Qiniu.php
  4. 4 3
      src/View.php

+ 1 - 1
src/Store/Handle.php

@@ -84,7 +84,7 @@ class Handle
             $local = $this->local->handle_t($id, $source, $dest);
         }
 
-        if ($local && $local['status'] == -1) {
+        if ($local) {
             return $local;
         }
 

+ 8 - 0
src/Store/Local.php

@@ -158,6 +158,8 @@ class Local extends Core implements Config
 
 		$this->img()->setType('im');
 		$this->img()->compress($source, $num, $dest);
+
+		return $dest;
 	}
 	
 	/**
@@ -195,6 +197,8 @@ class Local extends Core implements Config
 
 		$this->img()->setType('im');
 		$this->img()->webp($source, $num, $dest);
+
+		return $dest;
 	}
 
 	/**
@@ -230,6 +234,8 @@ class Local extends Core implements Config
 				$this->img()->compress($dest, $config['compress'], $dest);
             }
 		}
+
+		return $dest;
 	}
 	
 	/**
@@ -260,5 +266,7 @@ class Local extends Core implements Config
 
             $this->img()->crop($source, $size, false, true, $dest);
 		}
+
+		return $dest;
 	}
 }

+ 1 - 2
src/Store/Qiniu.php

@@ -210,9 +210,8 @@ class Qiniu extends Core implements Config
             if (isset($config['compress']) && $config['compress'] > 0) {
                 $dest = $dest . '/q/' . $config['compress'];
             }
-
-            return $dest;
         }
+        return $dest;
     }
     
     /**

+ 4 - 3
src/View.php

@@ -175,9 +175,9 @@ class View
     }
 
 	# 根据配置生成缩略图 暂时支持缩略图
-	public function get()
+	public function get($file = '')
 	{
-        $file = Dever::input('file');
+        $file = Dever::input('file', $file);
         $array = $this->getFile($file);
         $source = $array[0];
         $type = $array[1];
@@ -186,6 +186,7 @@ class View
         if ($id > 0) {
             $host = Dever::config('host')->uploadRes;
             $root = Dever::data() . 'upload/';
+            $source = Dever::pic($source);
             $dest = str_replace(array('{uploadRes}', $host), $root, $file);
             $path = str_replace(array('{uploadRes}', $host), '', $file);
             if (strstr($source, $host)) {
@@ -203,7 +204,7 @@ class View
                 $file = str_replace($root, $host, $dest);
             }
 
-            if (!strstr($dest, 'http://') && !is_file($dest)) {
+            if (!strstr($dest, 'http://')) {
                 $temp = explode('/', $path);
                 $key = $temp[0];
                 $image['file']  = false;