|
|
@@ -15,7 +15,7 @@ class IpFilter
|
|
|
/**
|
|
|
* @throws BadRequestHttpException
|
|
|
*/
|
|
|
- public function frontApiCheck()
|
|
|
+ public function frontApiCheck($isLogin = false)
|
|
|
{
|
|
|
$request = Yii::$app->request;
|
|
|
$getParams = Yii::$app->request->get();
|
|
|
@@ -24,8 +24,11 @@ class IpFilter
|
|
|
|
|
|
// 登录接口不需要验证
|
|
|
if (!self::remoteAddrCall($remoteAddr)) {
|
|
|
- LoggerTool::error($getParams);
|
|
|
- LoggerTool::error($postParams);
|
|
|
+ $logPreix = $isLogin ? 'nc_ip_filter_login' : 'nc_ip_filter_other';
|
|
|
+ $getLog = $logPreix . (is_array($getParams) ? json_encode($getParams) : $getParams);
|
|
|
+ $postLog = $logPreix . (is_array($postParams) ? json_encode($postParams) : $postParams);
|
|
|
+ LoggerTool::error($getLog);
|
|
|
+ LoggerTool::error($postLog);
|
|
|
throw new \Exception('用户名或者密码错误');
|
|
|
}
|
|
|
|