作者 赵彬吉
@@ -126,14 +126,19 @@ class NoticeController extends BaseController @@ -126,14 +126,19 @@ class NoticeController extends BaseController
126 return $this->error('other_domain参数必须为数组'); 126 return $this->error('other_domain参数必须为数组');
127 } 127 }
128 128
  129 + $origin_array = parse_url($origin_domain);
  130 + $origin_domain = $origin_array['host'] ?? '';
129 if (empty($origin_domain)) { 131 if (empty($origin_domain)) {
130 return $this->error('origin_domain参数不能为空'); 132 return $this->error('origin_domain参数不能为空');
131 } 133 }
132 134
  135 + $target_array = parse_url($target_domain);
  136 + $target_domain = $target_array['host'] ?? '';
133 if (empty($target_domain)) { 137 if (empty($target_domain)) {
134 return $this->error('target_domain参数不能为空'); 138 return $this->error('target_domain参数不能为空');
135 } 139 }
136 140
  141 +
137 if(!check_domain_record($origin_domain,['domain'=>'','ip'=>DomainInfo::SERVER_IP_301])){ 142 if(!check_domain_record($origin_domain,['domain'=>'','ip'=>DomainInfo::SERVER_IP_301])){
138 return $this->error($origin_domain . ' 未解析至 ' . DomainInfo::SERVER_IP_301); 143 return $this->error($origin_domain . ' 未解析至 ' . DomainInfo::SERVER_IP_301);
139 } 144 }
@@ -62,10 +62,8 @@ class SyncService @@ -62,10 +62,8 @@ class SyncService
62 ]; 62 ];
63 list($code, $result) = $this->curlRequest($url, $data); 63 list($code, $result) = $this->curlRequest($url, $data);
64 Log::info('同步收件信息至表单系统: 项目ID:' . $project_id . ', data: ' . var_export($data, true) . ', result: ' . $result); 64 Log::info('同步收件信息至表单系统: 项目ID:' . $project_id . ', data: ' . var_export($data, true) . ', result: ' . $result);
65 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);  
66 return true; 65 return true;
67 } catch (\Exception $e) { 66 } catch (\Exception $e) {
68 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($e->getMessage(), true) . PHP_EOL, FILE_APPEND);  
69 Log::info('同步收件信息至表单系统: 项目ID:' . $project_id . ', error: ' . $e->getMessage()); 67 Log::info('同步收件信息至表单系统: 项目ID:' . $project_id . ', error: ' . $e->getMessage());
70 return false; 68 return false;
71 } 69 }