49 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-01-20 13:21:50 +08:00
import api from '../../utils/http.js'
// API 基础路径
const BASE_PATH = '/corp'
/**
* 获取用户签名
* @param {string} userId - 用户ID
* @returns {Promise} 返回包含 userSig 信息的 Promise
*/
export const getUserSig = (userId) => {
return api.post(`${BASE_PATH}/tencent-im/user-sig`, { userId })
}
export async function getChatStatus(chatGroupId) {
return api.post(`${BASE_PATH}/tencent-im/get-chat-status`, { chatGroupId, role: 'patient' })
}
export const sendSystemMessage = (groupId, data, Desc = '', Ext = '') => {
return api.post(`${BASE_PATH}/tencent-im/send-group-message`, {
groupId,
msgBody: [
{
MsgType: "TIMCustomElem",
MsgContent: {
Data: data,
Desc,
Ext
}
}
]
})
}
/**
* 获取群组聊天记录POST请求
* @param {string} groupId - 群组ID
* @param {number} limit - 每页数量默认20最大100
* @param {number} skip - 跳过数量默认0
* @returns {Promise} 返回包含聊天记录的 Promise
*/
export const getChatRecordsByGroupId = (groupId, limit = 20, skip = 0) => {
return api.post(`${BASE_PATH}/tencent-im/chat-records`, {
GroupId: groupId,
limit,
skip
})
}