|
@@ -54,7 +54,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, computed, watch, onMounted } from "vue";
|
|
|
-import { chat } from "@/api/chatglm/chatglm.js";
|
|
|
+import { chat,getUuid } from "@/api/chatglm/chatglm.js";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import send from "@/assets/images/send.png";
|
|
|
import { getToken } from "@/utils/auth";
|
|
@@ -79,7 +79,7 @@ const msg = ref([
|
|
|
// 这里的数值可能需要根据实际的CSS调整
|
|
|
const baseInputHeight = 52;
|
|
|
const maxInputHeight = 115;
|
|
|
-const enterChat = () => {
|
|
|
+const enterChat =async () => {
|
|
|
if (disabled.value) return;
|
|
|
disabled.value = true;
|
|
|
const newUser = {
|
|
@@ -97,9 +97,10 @@ const enterChat = () => {
|
|
|
const longArr = msg.value.slice(msg.value.length - 11, msg.value.length);
|
|
|
query = [msg.value[0], ...longArr];
|
|
|
}
|
|
|
- fetch(`${wangzhi}/chat-glm3`, {
|
|
|
- method: "post",
|
|
|
- body: JSON.stringify(query),
|
|
|
+ const uuid = await getUuid(query)
|
|
|
+ // console.log("uuid", uuid);
|
|
|
+ fetch(`${wangzhi}/chat-glm3/chat?uuid=${uuid.msg}`, {
|
|
|
+ method: "get",
|
|
|
headers: {
|
|
|
"Content-Type": "application/json",
|
|
|
Authorization: "Bearer " + getToken(),
|