浏览代码

chang function async

tycoding 11 月之前
父节点
当前提交
cb0acb9b50

+ 3 - 3
langchat-ui-client/src/views/modules/chat/index.vue

@@ -42,13 +42,13 @@
   const aiChatId = ref<string>('');
   const inputRef = ref();
 
-  onMounted(async () => {
+  onMounted(() => {
     if (inputRef.value && !isMobile.value) {
       inputRef.value?.focus();
     }
-    await chatStore.loadData();
+    chatStore.loadData();
     if (chatStore.conversations.length == 0) {
-      await chatStore.addConversation({ title: 'New Chat' });
+      chatStore.addConversation({ title: 'New Chat' });
     }
   });
   onUnmounted(() => {

+ 2 - 2
langchat-ui-client/src/views/modules/doc/components/FileList.vue

@@ -29,8 +29,8 @@
   const isEdit = ref(0);
   const docStore = useDocStore();
 
-  onMounted(async () => {
-    await fetchData();
+  onMounted(() => {
+    fetchData();
   });
 
   async function fetchData() {

+ 1 - 1
langchat-ui-client/src/views/modules/home/index.vue

@@ -37,7 +37,7 @@
       loop: true,
     });
 
-    await fetchData();
+    fetchData();
   });
 
   async function fetchData() {

+ 4 - 2
langchat-ui-client/src/views/profile/index.vue

@@ -23,8 +23,10 @@
 
   const form = ref();
   const loading = ref(true);
-  onMounted(async () => {
-    form.value = await info();
+  onMounted(() => {
+    info().then((res: any) => {
+      form.value = res;
+    });
     loading.value = false;
   });
 </script>