feat: 强制content为string
All checks were successful
Egg CI/CD / build-image (push) Successful in 22s
Egg CI/CD / deploy (push) Successful in 19s

This commit is contained in:
zhaoyingbo 2024-03-05 02:07:05 +00:00
parent 5f7816f139
commit 36b602da61

View File

@ -45,11 +45,16 @@ export const manageMessageReq = async (req: Request) => {
// 发送消息列表
const sendList = [] as Promise<any>[];
const finalContent =
typeof body.content !== "string"
? JSON.stringify(body.content)
: body.content;
// 构造发送消息函数
const makeSendFunc = (receive_id_type: ReceiveIDType) => {
return (receive_id: string) => {
sendList.push(
sendMsg(receive_id_type, receive_id, body.msg_type, body.content).then(
sendMsg(receive_id_type, receive_id, body.msg_type, finalContent).then(
(res) => {
sendRes[receive_id_type][receive_id] = res;
}