聊天室完成

This commit is contained in:
2025-12-24 16:32:06 +08:00
parent 898da3a2c6
commit ad03f3f2db
16 changed files with 432 additions and 53 deletions

View File

@@ -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: {

View File

@@ -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消息管理 ======================
/**