update
This commit is contained in:
@@ -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';
|
||||||
|
|||||||
@@ -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']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user