Jelajahi Sumber

:bug: 并非所有的路径都有返回值

visuddhinanda 5 tahun lalu
induk
melakukan
9cd873ef10
1 mengubah file dengan 9 tambahan dan 2 penghapusan
  1. 9 2
      app/dict/get_split_data.php

+ 9 - 2
app/dict/get_split_data.php

@@ -18,8 +18,15 @@ if($redis!==false){
 	#如果没有查巴缅替换拆分
 	if($redis->hExists("dict://comp",$inputWord)===TRUE){
 		$output = $redis->hGet("dict://comp",$inputWord) ;
-		echo $output;
-		exit;
+		if(empty($output)){
+			echo "[]";
+		}
+		else{
+			echo $output;
+		}
+	}
+	else{
+		echo "[]";
 	}
 }
 else{