From 6d4bc05b321e3b595fe154c15fdbfe7988715f2c Mon Sep 17 00:00:00 2001 From: donghaolin <17667510818@163.com> Date: Sun, 23 Feb 2025 22:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/userPermissionCode.js | 6 ++++++ src/views/chat.vue | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/store/userPermissionCode.js b/src/store/userPermissionCode.js index b8f342f..f3a1d13 100644 --- a/src/store/userPermissionCode.js +++ b/src/store/userPermissionCode.js @@ -39,6 +39,12 @@ export const useUserInfo = () => { return '' } + const getToken = () => { + const token = getQueryVariable('token') + if (token) { + localStorage.setItem('localToken', token) + } + } const fetchUserInfo = async () => { getAppToken.value = localStorage.getItem('localToken') diff --git a/src/views/chat.vue b/src/views/chat.vue index 90d6f65..944943a 100644 --- a/src/views/chat.vue +++ b/src/views/chat.vue @@ -34,7 +34,7 @@ const sessionId = ref(localStorage.getItem('sessionId') || {}); const add = async () => { try { const result = await axios.post( - "http://c6bi3f.natappfree.cc/api/v1/chats/8b37cd9cf0c811efa4210242ac120003/completions", + "http://2zhyw2.natappfree.cc/api/v1/chats/8b37cd9cf0c811efa4210242ac120003/completions", {}, { headers: { @@ -132,7 +132,7 @@ const sendMessage = async () => { try { // 调用API获取回复 - const response = await fetch("http://c6bi3f.natappfree.cc/api/v1/chats/8b37cd9cf0c811efa4210242ac120003/completions", { + const response = await fetch("http://2zhyw2.natappfree.cc/api/v1/chats/8b37cd9cf0c811efa4210242ac120003/completions", { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ragflow-hkNjEwYjcwZjBlMDExZWZiYjYzMDI0Mm' }, body: JSON.stringify({ question: content, stream: false, session_id: sessionId.value })