This commit is contained in:
xd
2025-06-05 22:47:41 +08:00
parent ed99c7b1ae
commit 6805b590c7
17 changed files with 144 additions and 56 deletions

View File

@ -18,7 +18,7 @@ import {
IChatActionDetail,
ChatWatchRequest,
} from '@/types/message';
import { getRoleType } from '@/utils/app';
import { getRoleTypeWithDefault } from '@/utils/app';
import { logWithPrefix, oncePromise } from '@/utils/common';
import { collectEvent } from '@/utils/event';
import { navigateTo } from '@/utils/route';
@ -60,12 +60,12 @@ export const requestMessageList = oncePromise(async () => {
});
export const requestChatDetail = (chatId: string) => {
const data = { chatId, roleType: getRoleType() };
const data = { chatId, roleType: getRoleTypeWithDefault() };
return http.post<IChatInfo>(API.MESSAGE_CHAT, { data, contentType: 'application/x-www-form-urlencoded' });
};
export const requestNewChatMessages = (params: GetNewChatMessagesRequest) => {
const data = { ...params, roleType: getRoleType() };
const data = { ...params, roleType: getRoleTypeWithDefault() };
return http.post<IChatMessage[]>(API.MESSAGE_CHAT_NEW, { data });
};