修改了无参数请求时返回的json内容

新增返回服务器时间
This commit is contained in:
Bigsk 2020-07-24 14:06:49 +08:00 committed by Gitee
parent 7c4935e2b9
commit 32aafb6d8d

View File

@ -2,7 +2,7 @@
session_start();
if($_SERVER['HTTP_HOST'] == 'gemcapi.ghink.net'){
if($_GET['path'] == null){
echo '{"wikis": "https://gitee.com/ghink/gemcapi/wikis"}';
echo '{"wikis": "https://gitee.com/ghink/gemcapi/wikis","serverid": "cn-19;gemcapi-jump-s1","servertime": "'.date('Y-m-d H:i:s').'"}';
}else{
if($_GET['token'] == null){
if($_SESSION['times1'] < 11){
@ -30,7 +30,7 @@ $ipinfo=json_decode($ipinfo);
foreach($ipinfo as $ii=>$ii2){
$$ii = $ii2;
}
$link=mysqli_connect("localhost","gemcapi","ghink2014","gemcapi");
$link=mysqli_connect("localhost","gemcapi","ghink2014","gemcapi", 10202);
//Deal the data of province_day.
$result=mysqli_query($link,"SELECT * FROM `province_day` WHERE `date`='".date("Y-m-d")."'");
if(empty(mysqli_fetch_array($result))){
@ -1173,5 +1173,4 @@ if(empty(mysqli_fetch_array($result))){
}
}
}
mysqli_close($link);//Close the link with database.