瀏覽代碼

:bug: 密码非空时调用$redis->auth

visuddhinanda 4 年之前
父節點
當前提交
b6ba1af322
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      public/app/redis/function.php

+ 3 - 1
public/app/redis/function.php

@@ -6,8 +6,10 @@ function redis_connect()
 		//code...
 		$redis = new redis();
 		$r_conn = $redis->connect(Redis["host"], Redis["port"]);
-		$redis->auth(Redis["password"]);
 		if ($r_conn) {
+			if(Redis["password"] !== ""){
+				$redis->auth(Redis["password"]);
+			}		
 			return $redis;
 		} else {
 			return false;