This commit is contained in:
2022-07-06 11:21:58 +08:00
committed by jhx
parent 9efc042f47
commit deaef05e01
2 changed files with 6 additions and 3 deletions
+3 -3
View File
@@ -7,12 +7,12 @@ use support\Request;
class Index class Index
{ {
public function index(Request $request) public function index(Request $request, $checkIp = null)
{ {
$ip = $request->getRealIp(); $ip = $request->getRealIp();
if ($check = $request->get('ip')) { if ($checkIp) {
$ip = gethostbyname($check); $ip = gethostbyname($checkIp);
} }
$filepath = '/usr/src/myapp/lib/qqwry.dat'; $filepath = '/usr/src/myapp/lib/qqwry.dat';
+3
View File
@@ -17,6 +17,9 @@ use Webman\Route;
Route::any('/', [\app\controller\Index::class, 'index']); Route::any('/', [\app\controller\Index::class, 'index']);
Route::any('/check[/{ip}]', [\app\controller\Index::class, 'index']);