聊天室完成
This commit is contained in:
@@ -10,9 +10,9 @@ declare const uni: {
|
||||
}
|
||||
|
||||
import type { ResultDomain } from '../types'
|
||||
|
||||
import { BASE_URL as CONFIG_BASE_URL } from '../config'
|
||||
// API 基础配置
|
||||
const BASE_URL = 'http://localhost:8180'
|
||||
const BASE_URL = CONFIG_BASE_URL
|
||||
|
||||
// 通用请求方法
|
||||
export function request<T>(options: {
|
||||
|
||||
@@ -105,6 +105,13 @@ export const workcaseChatAPI = {
|
||||
return request<ChatMemberVO>({ url: `${this.baseUrl}/room/${roomId}/members`, method: 'GET' })
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取当前用户在指定聊天室的未读消息数
|
||||
*/
|
||||
getUnreadCount(roomId: string, userId: string): Promise<ResultDomain<number>> {
|
||||
return request<number>({ url: `${this.baseUrl}/room/${roomId}/unread?userId=${userId}`, method: 'GET' })
|
||||
},
|
||||
|
||||
// ====================== ChatRoom消息管理 ======================
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user