Browse Source

second commit

cqpCow 11 months ago
parent
commit
2e6c1bae6b
1 changed files with 4 additions and 7 deletions
  1. 4 7
      app/Service/JRFIDServerService.php

+ 4 - 7
app/Service/JRFIDServerService.php

@@ -52,9 +52,7 @@ class JRFIDServerService extends Service
 
     public function getSite($data, $param){
         $url = config("j_rfid.site");
-        $token = $param['token'];
-        $header = ["Authorization: {$token}"];
-        list($status,$result) = $this->get_helper($url,$header);
+        list($status,$result) = $this->get_helper($url,$param['header']);
         if(! $status) return [false, $result];
 
         if(! empty($result['errorMessage'])) return [false, $result['errorMessage']];
@@ -71,8 +69,7 @@ class JRFIDServerService extends Service
             'produce_no' => $data['produce_no'],
             'site' => $data['site'],
         ];
-        $header = $param['header'];
-        list($status,$result) = $this->post_helper($url,json_encode($post),$header);
+        list($status,$result) = $this->post_helper($url,json_encode($post),$param['header']);
         if(! $status) return [false, $result];
 
         if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];
@@ -89,8 +86,8 @@ class JRFIDServerService extends Service
             'contract_no' => $data['contract_no'],
             'site' => $data['site'],
         ];
-        $header = $param['header'];
-        list($status,$result) = $this->post_helper($url,json_encode($post),$header);
+
+        list($status,$result) = $this->post_helper($url,json_encode($post),$param['header']);
         if(! $status) return [false, $result];
 
         if(! empty($result['status']) && $result['status'] == 'error') return [false, $result['msg']];