no message

This commit is contained in:
kuaifan 2022-06-08 11:42:04 +08:00
parent e463a844ff
commit efac5401bf

View File

@ -297,7 +297,7 @@ class DialogController extends AbstractController
// 内容过长转成文件发送 // 内容过长转成文件发送
$path = "uploads/chat/" . date("Ym") . "/" . $dialog_id . "/"; $path = "uploads/chat/" . date("Ym") . "/" . $dialog_id . "/";
Base::makeDir(public_path($path)); Base::makeDir(public_path($path));
$path = $path . md5($text) . ".txt"; $path = $path . md5($text) . ".htm";
$file = public_path($path); $file = public_path($path);
file_put_contents($file, $text); file_put_contents($file, $text);
$size = filesize(public_path($path)); $size = filesize(public_path($path));
@ -305,7 +305,7 @@ class DialogController extends AbstractController
return Base::retError('消息发送保存失败'); return Base::retError('消息发送保存失败');
} }
$fileData = [ $fileData = [
'name' => "LongText-{$strlen}.txt", 'name' => "LongText-{$strlen}.htm",
'size' => $size, 'size' => $size,
'file' => $file, 'file' => $file,
'path' => $path, 'path' => $path,
@ -313,7 +313,7 @@ class DialogController extends AbstractController
'thumb' => '', 'thumb' => '',
'width' => -1, 'width' => -1,
'height' => -1, 'height' => -1,
'ext' => 'txt', 'ext' => 'htm',
]; ];
return WebSocketDialogMsg::sendMsg($dialog_id, 'file', $fileData, $user->userid); return WebSocketDialogMsg::sendMsg($dialog_id, 'file', $fileData, $user->userid);
} }