dever 3 years ago
parent
commit
b01963af7f
2 changed files with 9 additions and 3 deletions
  1. 6 2
      lib/Api.php
  2. 3 1
      lib/Parse.php

+ 6 - 2
lib/Api.php

@@ -204,8 +204,12 @@ class Api
 
 	private function parse($url, $project, $rule, $param, $col, $set, $push)
 	{
-		$parse = new Parse($url, $project, $rule, $param, $col, $set, $push);
-		return $parse->get();
+		try {
+			$parse = new Parse($url, $project, $rule, $param, $col, $set, $push);
+			return $parse->get();
+		} catch (\Exception $e) {
+            return false;
+        }
 	}
 
 	private function page($source, $type, $config, $col, $set)

+ 3 - 1
lib/Parse.php

@@ -258,7 +258,9 @@ class Parse
 			return $file;
 		}
 		$data = Dever::load('upload/save.copy?file=' . $file . '&key=' . $this->res . '&state=1');
-		if (isset($data['url'])) {
+		if (isset($data['status']) && $data['status'] == -1) {
+			return '';
+		} elseif (isset($data['url'])) {
 			return $data['url'];
 		} else {
 			return '';