From e86d0a7cbe28d969e608bd8e1d6bece3a8581ed8 Mon Sep 17 00:00:00 2001 From: weiz Date: Thu, 16 Nov 2023 11:39:33 +0800 Subject: [PATCH 1/2] update --- app/adminapi/controller/company/CompanyController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/adminapi/controller/company/CompanyController.php b/app/adminapi/controller/company/CompanyController.php index 88119670..f539340d 100644 --- a/app/adminapi/controller/company/CompanyController.php +++ b/app/adminapi/controller/company/CompanyController.php @@ -57,7 +57,8 @@ if(empty($params['company_name']) || empty($params['organization_code']) || empty($params['company_type']) || empty($params['master_name']) || empty($params['master_phone'])){ return $this->fail('缺少必要参数'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/create',http_build_query($params),$this->reqHeader); + $this->reqHeader[] = 'Content-Type: application/json; charset=utf-8'; + $result = curl_post(env('project.worker_domain').'/middleapi/company/create',json_encode($params,true),$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } -- 2.40.1 From b5eab3df006c6cecd4510d041184f2d2ad8bafce Mon Sep 17 00:00:00 2001 From: weiz Date: Thu, 16 Nov 2023 11:40:25 +0800 Subject: [PATCH 2/2] update --- app/adminapi/controller/company/CompanyController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/adminapi/controller/company/CompanyController.php b/app/adminapi/controller/company/CompanyController.php index f539340d..673787a2 100644 --- a/app/adminapi/controller/company/CompanyController.php +++ b/app/adminapi/controller/company/CompanyController.php @@ -72,7 +72,8 @@ if(empty($params['id']) || empty($params['company_name']) || empty($params['organization_code']) || empty($params['company_type']) || empty($params['master_name']) || empty($params['master_phone'])){ return $this->fail('缺少必要参数'); } - $result = curl_post(env('project.worker_domain').'/middleapi/company/edit',http_build_query($params),$this->reqHeader); + $this->reqHeader[] = 'Content-Type: application/json; charset=utf-8'; + $result = curl_post(env('project.worker_domain').'/middleapi/company/edit',json_encode($params,true),$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); } -- 2.40.1