baseUrl = 'https://uat.oriza.com'; $this->customerId = '1947941625517604864'; $this->authKey = '59C8ED8584EE4BA7BC22FC63BE45C73D'; } public function getHeader() { $timestamp = time() * 1000; $token = $this->customerId . $timestamp . $this->authKey; $token = md5($token); $token = strtoupper($token); $header[] = 'Content-Type: application/json'; $header[] = "customerId: {$this->customerId}"; $header[] = "timestamp: {$timestamp}"; $header[] = "token: {$token}"; return $header; } /** * 公司查询 */ public function companyInfo($params) { $params = json_encode($params); $url = $this->baseUrl . '/master-service/openapi/businessCollege/enterprise/info'; $header = $this->getHeader(); try { $result = httpCurl($url, 'POST', $params, $header); $result = json_decode($result, true); if ($result['code'] == 200) { return $result['data']; } else { return false; } } catch (\Exception $e) { return false; } } }