瀏覽代碼

:bug: !isset($_COOKIE["user_uid"]) 返回空数组

visuddhinanda 2 年之前
父節點
當前提交
45b4deaf8e
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      public/app/channal/get.php

+ 4 - 4
public/app/channal/get.php

@@ -6,7 +6,7 @@ require_once "../public/_pdo.php";
 require_once '../ucenter/function.php';
 require_once '../share/function.php';
 
-if(!isset($_COOKIE["userid"])){
+if(!isset($_COOKIE["userid"]) || !isset($_COOKIE["user_uid"])){
 	echo json_encode(array(), JSON_UNESCAPED_UNICODE);
 	exit;
 }
@@ -73,9 +73,9 @@ $output = array();
 foreach ($channelList as $key => $value) {
     # code...
 	$new = $value;
-	$name = $_userinfo->getName($value["owner_uid"]);	
+	$name = $_userinfo->getName($value["owner_uid"]);
 	$new["username"] = $name["username"];
-	$new["nickname"] = $name["nickname"];	
+	$new["nickname"] = $name["nickname"];
 	$new["count"] = 0;
     $new["all"] = 1;
     $new["owner"] = $value["owner_uid"];
@@ -85,4 +85,4 @@ foreach ($channelList as $key => $value) {
 
 echo json_encode($output, JSON_UNESCAPED_UNICODE);
 
-?>
+?>