fix: 修复飞书消息 emoji 编码问题
- 在 json_encode 中使用 JSON_UNESCAPED_UNICODE 标志 - 修复 sendMessage() 方法中的 JSON 编码 - 修复 updateMessageCards() 方法中的 JSON 编码 - 解决飞书 API 报错 200621 (parse card json err)
This commit is contained in:
@@ -563,7 +563,8 @@ class FeishuNotificationService
|
||||
$app = $this->getAppConfig();
|
||||
$token = $this->getAccessToken();
|
||||
|
||||
$content = json_encode(['card' => $card]);
|
||||
// 使用 JSON_UNESCAPED_UNICODE 避免 emoji 被转义
|
||||
$content = json_encode(['card' => $card], JSON_UNESCAPED_UNICODE);
|
||||
|
||||
error_log('📤 发送飞书消息: app_id=' . $app['app_id'] . ', feishu_user_id=' . $feishuUserId);
|
||||
error_log('📦 消息卡片: ' . json_encode($card, JSON_UNESCAPED_UNICODE));
|
||||
@@ -713,7 +714,8 @@ class FeishuNotificationService
|
||||
"https://open.feishu.cn/open-apis/im/v1/messages/{$message->message_id}/update",
|
||||
[
|
||||
'msg_type' => 'interactive',
|
||||
'content' => json_encode(['card' => $updatedCard]),
|
||||
// 使用 JSON_UNESCAPED_UNICODE 避免 emoji 被转义
|
||||
'content' => json_encode(['card' => $updatedCard], JSON_UNESCAPED_UNICODE),
|
||||
],
|
||||
[
|
||||
'Authorization: Bearer ' . $token,
|
||||
|
||||
Reference in New Issue
Block a user