|
|
@@ -23,14 +23,14 @@ class IpFilter extends Component
|
|
|
public function checkIp()
|
|
|
{
|
|
|
$request = Yii::$app->request;
|
|
|
+ $getParams = Yii::$app->request->get();
|
|
|
+ $postParams = Yii::$app->request->post();
|
|
|
$remoteAddr = $_SERVER['REMOTE_ADDR']; // 获取用户 IP 地址
|
|
|
|
|
|
// 登录接口不需要验证
|
|
|
- if ($request->getUrl() === '/v1/oauth/login') {
|
|
|
-// throw new BadRequestHttpException('用户名或者密码错误');
|
|
|
- }
|
|
|
- // 调用远程 IP 地址查询方法
|
|
|
if (!self::remoteAddrCall($remoteAddr)) {
|
|
|
+ Yii::info('GET 参数: ' . json_encode(is_array($getParams) ? $getParams : [], JSON_PRETTY_PRINT), __METHOD__);
|
|
|
+ Yii::info('POST 参数: ' . json_encode(is_array($postParams) ? $getParams : [], JSON_PRETTY_PRINT), __METHOD__);
|
|
|
throw new BadRequestHttpException('用户名或者密码错误');
|
|
|
}
|
|
|
}
|