From 70f7ee95285a17d5e057004643c420023108fc6e Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Tue, 13 Sep 2022 13:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/avatar/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/avatar/index.php b/api/avatar/index.php index 9736213..9574b63 100644 --- a/api/avatar/index.php +++ b/api/avatar/index.php @@ -13,12 +13,12 @@ $studentID = htmlspecialchars($_GET['studentID']); // 函数构建 if (!empty($studentID)) { // 数据库获取 - $result_avatar = mysqli_query($sql_conn,"SELECT * FROM ".$setting['SQL_DATA']['info']." WHERE studentID='$studentID'"); + $result_avatar = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['info']." WHERE studentID='$studentID'"); $result_avatar_object = mysqli_fetch_object($result_avatar); // 检查是否存在 - if (isset($result_avatar_object->icon) == TRUE) { + if (!empty($result_avatar_object->qq)) { // 若正确信息返回数据 - header('location:'.$result_avatar_object->icon); + header('location: https://q1.qlogo.cn/g?b=qq&nk='.$result_avatar_object->qq.'&s=640'); } else { // 如果数据错误返回不存在 header('location: ./logo.jpg');