service = $service; } public function notificationEmail(Request $request) { $signature = $request->input('signature'); $timestamp = $request->input('timestamp'); $emails = []; $validTime = time() - 7200; if (!empty($signature) && !empty($timestamp) && $timestamp > $validTime) { $params = ['global_key' => 'MP_SYSTEM_MESSAGES']; $data = $this->service->getGlobalConfigInfo($params); if(!empty($data['value'])) { $mpSystemMessages = json_decode($data['value'], true); if(!empty($mpSystemMessages['sys_app_key']) && md5($mpSystemMessages['sys_app_key'].$timestamp) == $signature) { //通过校验 $emails = $mpSystemMessages['to_mail']; } } } else { throw new ApiException(500); } return $this->jsonResponse( 'ok', $emails ); } }