diff --git a/components/i/Create.vue b/components/i/Create.vue index e11755776d34e86a89b3e19417d92cdfe6faec2e..8a27a07f74302712a9d3d3e643e2e324d861c9af 100644 --- a/components/i/Create.vue +++ b/components/i/Create.vue @@ -37,6 +37,7 @@ diff --git a/stores/search.js b/stores/search.js new file mode 100644 index 0000000000000000000000000000000000000000..c7acc12c2c4f44f0f760c8fac27911aeb00eaa6c --- /dev/null +++ b/stores/search.js @@ -0,0 +1,12 @@ +import { defineStore } from 'pinia' + +export const useSearchStore = defineStore('search', () => { + const { $isSignIn } = useUserStore() + const $searchHistory = ref([]) + async function $getSearchHistory () { + if (!$isSignIn) return + const { data } = await useRequest('/v1/chat/completion/list') + $searchHistory.value = data.value.data + } + return { $searchHistory, $getSearchHistory } +})