cqp 1 روز پیش
والد
کامیت
f02650f7b3
2فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 4 4
      app/Jobs/ManDeviceJobLf.php
  2. 1 1
      app/Service/ClearDataService.php

+ 4 - 4
app/Jobs/ManDeviceJobLf.php

@@ -81,21 +81,21 @@ class ManDeviceJobLf implements ShouldQueue
         list($status,$token) = ClearDataService::getTokenLf();
         if(! $status) return;
 
-        $url = $this->url . "api/module-data/device_machine_record/device_machine_record";
+        $url = $this->url . "/api/module-data/device_machine_record/device_machine_record/diy/create_single_data";
         $post = [
             'bizId' => -1,
             'bizTypeEk' => 'LOWCODE',
             'data' => [
                 'device_machine_record' => [
                     'machine_code' => $data['dev_eui'],
-                    'param_value' => $data['value'],
+                    'param_value' => floatval($data['value']),
                     'record_time' => $this->getNowDay()
                 ]
             ],
             'dynamicFormId' => '477743923368955904',
             'showModelId' => '477745421456904192'
         ];
-        $header = ["Authorization: Bearer {$token}","Content-Type:application/json"];
+        $header = ["Authorization: Bearer {$token}","Content-Type:application/json","Site:LFMY"];
 
         $curl = curl_init();
         curl_setopt_array($curl, array(
@@ -123,7 +123,7 @@ class ManDeviceJobLf implements ShouldQueue
         curl_close($curl);
 
         $res = json_decode($response,true);
-        if(isset($res['code'])){//报错了
+        if(! isset($res['status'])){//报错了
             file_put_contents('record_man_lf_error.txt',date('Y-m-d H:i:s'). PHP_EOL . $response .PHP_EOL.json_encode($post),8);
         }
     }

+ 1 - 1
app/Service/ClearDataService.php

@@ -13,7 +13,7 @@ class ClearDataService extends Service
         $token = Redis::get($token_key);
         if(! $token){
             $url = config('ip.zslf');
-            $post = array("name" => "admin","password"=>"gzy#12345","rememberMe"=>true);
+            $post = array("name" => "LFMY001","password"=>"12345678","rememberMe"=>true);
             $header = ['Content-Type:application/json'];
             $curl = curl_init();
             curl_setopt_array($curl, array(