Browse Source

commit: fix error return with CDN network, close #6

master
dnomd343 3 years ago
parent
commit
360a2a8576
  1. 6
      backend/queryInfo.php

6
backend/queryInfo.php

@ -5,7 +5,11 @@ include('qrcode.php');
include('getInfo.php');
function getClientIP() { // 获取客户端IP
return isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return trim(explode(",", $_SERVER['HTTP_X_FORWARDED_FOR'])[0]);
} else {
return $_SERVER['REMOTE_ADDR'];
}
}
function formatDate($str) { // 将YYYYMMDD处理为YYYY-MM-DD

Loading…
Cancel
Save