|
@@ -12,13 +12,14 @@ class Handle
|
|
|
*/
|
|
|
public function __construct($data = array())
|
|
|
{
|
|
|
+ $this->yun = $this->local = false;
|
|
|
$config = Dever::db('upload/upload')->one($data['key']);
|
|
|
|
|
|
$this->save_type = $config['save_type'];
|
|
|
|
|
|
- $this->yun = $config['yun'];
|
|
|
+ $yun = $config['yun'];
|
|
|
if ($this->save_type >= 2) {
|
|
|
- if ($this->yun == 1) {
|
|
|
+ if ($yun == 1) {
|
|
|
$yun = 'Upload\Src\Store\Qiniu';
|
|
|
}
|
|
|
|
|
@@ -38,9 +39,19 @@ class Handle
|
|
|
$local = $this->local->copy();
|
|
|
}
|
|
|
|
|
|
+ if ($local && $local['status'] == -1) {
|
|
|
+ return $local;
|
|
|
+ }
|
|
|
+
|
|
|
if ($this->save_type >= 2) {
|
|
|
$yun = $this->yun->copy();
|
|
|
}
|
|
|
+
|
|
|
+ if ($this->local) {
|
|
|
+ $this->local->delete();
|
|
|
+ } elseif ($this->yun) {
|
|
|
+ $this->yun->delete();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if ($this->save_type <= 2) {
|