配置 IM 中的文件上传到阿里云OSS;更新 路由白名单
Build Docker / build (push) Canceled after 0s

This commit is contained in:
haomingming
2026-08-20 11:38:23 +08:00
parent e836e84421
commit 4ad8d5fa6f
4 changed files with 136 additions and 0 deletions
+17
View File
@@ -1232,6 +1232,23 @@ class UserService extends BaseService
return $result;
}
// === 新增:投递上传OSS队列 ===
$mediaTypes = ['TIMImageElem', 'TIMSoundElem', 'TIMVideoFileElem', 'TIMFileElem'];
if (in_array($msg_data['MsgBody'][0]['MsgType'], $mediaTypes)) {
try {
$producer = \Hyperf\Context\ApplicationContext::getContainer()->get(\Hyperf\Amqp\Producer::class);
$producerMsg = new \App\Amqp\Producer\UploadImMediaProducer([
'message_key' => $msg_data['MsgKey'],
'msg_type' => $msg_data['MsgBody'][0]['MsgType'],
'msg_content' => $message_content,
]);
$producer->produce($producerMsg);
} catch (\Throwable $e) {
Log::getInstance("UserService-userImAfterSendMsg")->error("投递上传OSS队列失败: " . $e->getMessage());
}
}
// === 新增结束 ===
// im消息通知
if ($is_system == 0 && isset($message_send_result) && isset($order_inquiry_id)){
try {