cqpCow 1 年之前
父节点
当前提交
23668c9db9
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app/Service/AssetService.php

+ 4 - 1
app/Service/AssetService.php

@@ -137,7 +137,10 @@ class AssetService extends Service
 
     public function updateData($data){
         list($status,$msg) = $this->rule($data);
-        if(! $status) return [false, 'IP未入白名单'];
+        if(! $status) {
+            file_put_contents('record_ip.txt',date("Y-m-d H:i:s",time()).json_encode($data) . PHP_EOL."来源IP".$msg.PHP_EOL,8);
+            return [false, 'IP未入白名单'];
+        }
 
         dispatch(new AssetDeviceJob($data))->onQueue(Asset::Key_Queue);