留档笔记

``` '{"data":{"94:B0:1F:45:4D:96":{"airhandle":57263216,"airpid":4232,"name":"","srvname":"`Ͷ1","width":"375","height":"667","ip":"192.168.6.124","mac":"00:E0:99:C1:A6:3F","username":"iPhone","version":"16.6","model":"iPhone10,4","de viceid":"94:B0:1F:45:4D:96","device_name":"iPhone 8","location":"","location_crc":"B0DBD800","vid":"520A","pid":"0887","rotate":0,"state":1,"imgw":458,"imgh":812,"uid":"89,52,72,7A,43,BC","gid":"1"}},"status":0,"message":"ɹ","ms gid":0,"fun":"get_device_list"} ' ``` ![image.png](https://cos.easydoc.net/52287695/files/lmd8ktg7.png) ![image.png](https://cos.easydoc.net/52287695/files/lmd8l0qu.png) ``` <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'http://127.0.0.1:9912/api', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '{ "data": "", "fun": "get_device_list", "msgid": 0 }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); var_dump($response); var_dump(json_decode($response, true)); die; ``` ``` 问题解决了,$response = iconv('UTF-8', 'UTF-8//IGNORE', utf8_encode($response)); 需要这样处理下 ``` 异步转同步 > 将请求结果存入redis,设置过期时间,根据标识同步查询。超时则放弃查询。 ![image.png](https://cos.easydoc.net/52287695/files/lmd8pkxu.png) ![image.png](https://cos.easydoc.net/52287695/files/lmd8putd.png)