feat(ui): Support multi knowledgebases operation
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { resetTestDataLoaded } from '@/api/test-data'
|
||||
import { ref, computed } from 'vue'
|
||||
import type { UserInfo, TenantInfo, KnowledgeBaseInfo } from '@/api/auth'
|
||||
|
||||
@@ -85,10 +84,6 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
localStorage.removeItem('weknora_knowledge_bases')
|
||||
localStorage.removeItem('weknora_current_kb')
|
||||
|
||||
// 重置测试数据加载标志,确保重新登录后会重新获取KB列表
|
||||
try {
|
||||
resetTestDataLoaded()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const initFromStorage = () => {
|
||||
|
||||
@@ -4,8 +4,8 @@ import { defineStore } from "pinia";
|
||||
|
||||
export const knowledgeStore = defineStore("knowledge", {
|
||||
state: () => ({
|
||||
cardList: ref([]),
|
||||
total: ref(0),
|
||||
cardList: ref<any[]>([]),
|
||||
total: ref<number>(0),
|
||||
}),
|
||||
actions: {},
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import { defineStore } from 'pinia';
|
||||
export const useMenuStore = defineStore('menuStore', {
|
||||
state: () => ({
|
||||
menuArr: reactive([
|
||||
{ title: '知识库', icon: 'zhishiku', path: 'knowledgeBase' },
|
||||
{ title: '知识库', icon: 'zhishiku', path: 'knowledge-bases' },
|
||||
{
|
||||
title: '对话',
|
||||
icon: 'prefixIcon',
|
||||
@@ -13,8 +13,7 @@ export const useMenuStore = defineStore('menuStore', {
|
||||
childrenPath: 'chat',
|
||||
children: reactive<object[]>([]),
|
||||
},
|
||||
{ title: '账户信息', icon: 'tenant', path: 'tenant' },
|
||||
{ title: '系统设置', icon: 'setting', path: 'settings' },
|
||||
{ title: '系统信息', icon: 'tenant', path: 'tenant' },
|
||||
{ title: '退出登录', icon: 'logout', path: 'logout' }
|
||||
]),
|
||||
isFirstSession: false,
|
||||
|
||||
Reference in New Issue
Block a user