Browse Source

测试接收数据 并保存到日志3

master
wanghongjun 2 years ago
parent
commit
41c43a1711
  1. 5
      app/controller/Index.php

5
app/controller/Index.php

@ -19,11 +19,10 @@ class Index extends BaseController
// 测试连接
public function msg(){
$handle = fopen('php://input', 'r');
$param = Request::param() ?? [];
$input = stream_get_contents($handle);
fclose($handle);
$urlOrIp = Request::host(true);# false = 地址、true = IP
Log::info(json_encode($param));
Log::info($urlOrIp);
return json(['code' => 200, 'msg' => '成功']);
}
}

Loading…
Cancel
Save