wujingjing
2024-11-22 7385b6c2b3ba3b4a1a2e6482db9ff63be0c235c8
经纬度
已修改2个文件
12 ■■■■■ 文件已修改
src/components/chat/Chat.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/stores/chatRoom.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/Chat.vue
@@ -307,6 +307,7 @@
import { ErrorCode } from '/@/utils/request';
import { toMyFixed } from '/@/utils/util';
import { findLast, orderBy } from 'lodash-es';
import { getCurrentPosition } from '/@/utils/brower';
const chatWidth = '75%';
const voicePageIsShow = ref(false);
let isTalking = ref(false);
@@ -422,7 +423,7 @@
const DEFAULT_SECTION_A_ID = 'knowledge_base';
let questionRes = null;
let position = null;
let finalCalcSectionAId = null;
const questionAi = async (text) => {
    let judgeParams = null;
@@ -463,6 +464,12 @@
        raw_mode: roomConfig.value?.[currentRouteId]?.isAnswerByLLM ?? false,
        ...judgeParams,
    } as any;
    if (position) {
        const longitude = position.coords.longitude;
        const latitude = position.coords.latitude;
        params.cur_pos = [longitude, latitude].join(',');
    }
    if (activeGroupType.value) {
        params.group_type = activeGroupType.value;
@@ -547,6 +554,7 @@
        ElMessage.warning('ai 正在回复中,请稍后尝试提问');
        return;
    }
    position = position ?? (await getCurrentPosition());
    const isNewChat = messageList.value.length === 0;
    if (isNewChat) {
src/stores/chatRoom.ts
@@ -6,6 +6,7 @@
import emitter from '../utils/mitt';
import { gotoRoute } from '../utils/route';
import { Local } from '../utils/storage';
/**
 * Room 关联的一些配置
 */
@@ -229,3 +230,4 @@
        reject(error);
    });
};