改进 UI 和删除聊天逻辑
All checks were successful
Build / build (push) Successful in 3m21s

This commit is contained in:
kingc2022 2024-10-26 19:20:59 +08:00
parent 6cde2335f5
commit 25190adaaf
4 changed files with 18 additions and 5 deletions

View File

@ -3,6 +3,7 @@
// @ts-nocheck // @ts-nocheck
// noinspection JSUnusedGlobalSymbols // noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import // Generated by unplugin-auto-import
// biome-ignore lint: disable
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue')['EffectScope'] const EffectScope: typeof import('vue')['EffectScope']
@ -105,6 +106,7 @@ declare module 'vue' {
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']> readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']> readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']> readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
readonly onWatcherCleanup: UnwrapRef<typeof import('vue')['onWatcherCleanup']>
readonly provide: UnwrapRef<typeof import('vue')['provide']> readonly provide: UnwrapRef<typeof import('vue')['provide']>
readonly reactive: UnwrapRef<typeof import('vue')['reactive']> readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
readonly readonly: UnwrapRef<typeof import('vue')['readonly']> readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
@ -122,9 +124,12 @@ declare module 'vue' {
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']> readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']> readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']> readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useId: UnwrapRef<typeof import('vue')['useId']>
readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
readonly useRoute: UnwrapRef<typeof import('vue-router/auto')['useRoute']> readonly useRoute: UnwrapRef<typeof import('vue-router/auto')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router/auto')['useRouter']> readonly useRouter: UnwrapRef<typeof import('vue-router/auto')['useRouter']>
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']> readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
readonly useTemplateRef: UnwrapRef<typeof import('vue')['useTemplateRef']>
readonly watch: UnwrapRef<typeof import('vue')['watch']> readonly watch: UnwrapRef<typeof import('vue')['watch']>
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']> readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']> readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>

View File

@ -27,8 +27,8 @@
<n-text depth="3"> <n-text depth="3">
我们有一些预设提示词您可以点击来一键输入 我们有一些预设提示词您可以点击来一键输入
</n-text> </n-text>
<n-scrollbar style="max-height: 400px"> <n-scrollbar style="max-height: 400px" class="mt-3">
<n-grid cols="1 s:2 l:3" responsive="screen"> <n-grid cols="1 m:2 l:3" responsive="screen">
<n-gi v-for="p in prompts" class="rounded-lg p-2"> <n-gi v-for="p in prompts" class="rounded-lg p-2">
<n-card <n-card
:title="p.act" :title="p.act"
@ -175,8 +175,6 @@
class="text-center block mt-2 mb-2 text-sm select-none" class="text-center block mt-2 mb-2 text-sm select-none"
> >
AI 也有可能犯错误请在使用之前核查信息 AI 也有可能犯错误请在使用之前核查信息
<br />
测试版本不代表最终品质
</n-text> </n-text>
</div> </div>
</div> </div>

View File

@ -36,7 +36,7 @@
</n-thing> </n-thing>
</n-list-item> </n-list-item>
</n-list> </n-list>
<div v-else> <div v-else class="mt-8">
<n-result <n-result
status="404" status="404"
title="你还没有对话" title="你还没有对话"
@ -99,6 +99,9 @@ const deleteChat = async (chatId: number) => {
onPositiveClick: async () => { onPositiveClick: async () => {
await getApi().Chat.apiV1ChatsIdDelete(chatId); await getApi().Chat.apiV1ChatsIdDelete(chatId);
await getChats(); await getChats();
if (parseInt(router.currentRoute.value.params.id) === chatId) {
router.push("/")
}
}, },
}); });
}; };

View File

@ -10,6 +10,13 @@ import AutoImport from "unplugin-auto-import/vite";
import { fileURLToPath, URL } from "node:url"; import { fileURLToPath, URL } from "node:url";
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler", // or "modern", "legacy"
},
},
},
resolve: { resolve: {
alias: { alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)), "@": fileURLToPath(new URL("./src", import.meta.url)),