From d11280d353ddd8daf8bfcdd2d3fe711114ee7597 Mon Sep 17 00:00:00 2001
From: yangyin <1850366751@qq.com>
Date: 星期五, 22 十一月 2024 11:11:13 +0800
Subject: [PATCH] Merge branch 'test' of http://47.103.154.90:83/r/WI/Web.V1.0 into test

---
 src/components/chat/Chat.vue |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/components/chat/Chat.vue b/src/components/chat/Chat.vue
index d55c3d9..2e6bd2a 100644
--- a/src/components/chat/Chat.vue
+++ b/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 姝e湪鍥炲涓紝璇风◢鍚庡皾璇曟彁闂�');
 		return;
 	}
+	position = position ?? (await getCurrentPosition());
 
 	const isNewChat = messageList.value.length === 0;
 	if (isNewChat) {

--
Gitblit v1.9.3