test(api): ✅ 测试接口,梳理逻辑
This commit is contained in:
+12
-10
@@ -6,13 +6,22 @@ import { useUserStore } from './user';
|
||||
export const useChatStore = defineStore('chat', () => {
|
||||
const userStore = useUserStore();
|
||||
|
||||
const chatMap = ref<Record<number, ChatMessageVo[]>>({});
|
||||
// 是否开启深度思考
|
||||
const isDeepThinking = ref<boolean>(false);
|
||||
|
||||
const setChatMap = (id: number, data: ChatMessageVo[]) => {
|
||||
const setDeepThinking = (value: boolean) => {
|
||||
isDeepThinking.value = value;
|
||||
};
|
||||
|
||||
// 会议ID对应-聊天记录 map对象
|
||||
const chatMap = ref<Record<string, ChatMessageVo[]>>({});
|
||||
|
||||
const setChatMap = (id: string, data: ChatMessageVo[]) => {
|
||||
chatMap.value[id] = data;
|
||||
};
|
||||
|
||||
const requestChatList = async (sessionId: number) => {
|
||||
// 获取当前会话的聊天记录
|
||||
const requestChatList = async (sessionId: string) => {
|
||||
// 如果没有 token 则不查询聊天记录
|
||||
if (!userStore.token)
|
||||
return;
|
||||
@@ -30,13 +39,6 @@ export const useChatStore = defineStore('chat', () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 是否开启深度思考
|
||||
const isDeepThinking = ref<boolean>(false);
|
||||
|
||||
const setDeepThinking = (value: boolean) => {
|
||||
isDeepThinking.value = value;
|
||||
};
|
||||
|
||||
return {
|
||||
chatMap,
|
||||
requestChatList,
|
||||
|
||||
@@ -19,7 +19,6 @@ export const useModelStore = defineStore('model', () => {
|
||||
try {
|
||||
const res = await getModelList();
|
||||
modelList.value = res.data;
|
||||
console.log('模型列表', res.data);
|
||||
}
|
||||
catch (error) {
|
||||
console.error('requestModelList错误', error);
|
||||
|
||||
Reference in New Issue
Block a user