perf: 优化错误提示

This commit is contained in:
kuaifan
2025-07-30 20:33:27 +08:00
parent a1a51914a2
commit 1b242dc04e
8 changed files with 20 additions and 40 deletions
@@ -1857,12 +1857,8 @@ class DialogController extends AbstractController
$down = Request::input('down', 'yes');
//
$msg = WebSocketDialogMsg::whereId($msg_id)->first();
if (empty($msg)) {
abort(403, "This file not exist.");
}
if ($msg->type != 'file') {
abort(403, "This file not support download.");
}
abort_if(empty($msg), 403, "This file not exist.");
abort_if($msg->type != 'file', 403, "This file not support download.");
$array = Base::json2array($msg->getRawOriginal('msg'));
//
if ($down === 'preview') {