更新可以更改图片
This commit is contained in:
parent
62bbcda141
commit
9119e7a27b
BIN
api/avatar/404.png
Normal file
BIN
api/avatar/404.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 962 B |
33
api/avatar/index.php
Normal file
33
api/avatar/index.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?PHP
|
||||
/*
|
||||
* XF_TLS 项目组 API 部
|
||||
* 全部代码未开源
|
||||
*/
|
||||
|
||||
// 载入头
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/api/header-control.php');
|
||||
|
||||
// 获取数据
|
||||
$studentID = htmlspecialchars($_GET['studentID']);
|
||||
|
||||
// 函数构建
|
||||
if (!empty($studentID)) {
|
||||
// 数据库获取
|
||||
$result_avatar = mysqli_query($sql_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) {
|
||||
// 若正确信息返回数据
|
||||
header('location:'.$result_avatar_object->icon);
|
||||
} else {
|
||||
// 如果数据错误返回不存在
|
||||
header('location: ./logo.jpg');
|
||||
}
|
||||
} else {
|
||||
// 没有参数返回404
|
||||
header('location: ./404.png');
|
||||
}
|
||||
|
||||
// 处理数据库
|
||||
mysqli_free_result($result_avatar);
|
||||
mysqli_close($sql_conn);
|
BIN
api/avatar/logo.jpg
Normal file
BIN
api/avatar/logo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
BIN
api/avatar/no.png
Normal file
BIN
api/avatar/no.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 596 B |
Loading…
Reference in New Issue
Block a user