sent2); if (! $sent) { return []; } // 过滤掉空值或非 uuid 的 channel,避免空 channels 参数导致 500 $channels = []; foreach (explode(',', (string) $request->input('channels', '')) as $channel) { if (Str::isUuid($channel)) { $channels[] = $channel; } } $mode = $request->input('mode', 'read'); $sentId = $sent->book.'-'.$sent->paragraph.'-'.$sent->word_begin.'-'.$sent->word_end; $Sent = new CorpusController; $data['sent'] = $Sent->getSentTpl($sentId, $channels, $mode); $data['sim'] = $this->sim; return $data; } }