fix:401、403错误提示,对话角色更改assistant,模型选择持久化
This commit is contained in:
@@ -4,21 +4,21 @@ import { getModelList } from '@/api';
|
||||
|
||||
// 模型管理
|
||||
export const useModelStore = defineStore('model', () => {
|
||||
// 当前模型
|
||||
// 当前模型(需要持久化)
|
||||
const currentModelInfo = ref<GetSessionListVO>({});
|
||||
|
||||
// 模型菜单列表(不需要持久化)
|
||||
const modelList = ref<GetSessionListVO[]>([]);
|
||||
|
||||
// 设置当前模型
|
||||
const setCurrentModelInfo = (modelInfo: GetSessionListVO) => {
|
||||
currentModelInfo.value = modelInfo;
|
||||
};
|
||||
|
||||
// 模型菜单列表
|
||||
const modelList = ref<GetSessionListVO[]>([]);
|
||||
// 请求模型菜单列表
|
||||
const requestModelList = async () => {
|
||||
try {
|
||||
const res = await getModelList();
|
||||
console.log('res', res);
|
||||
modelList.value = res.data;
|
||||
}
|
||||
catch (error) {
|
||||
@@ -32,4 +32,8 @@ export const useModelStore = defineStore('model', () => {
|
||||
modelList,
|
||||
requestModelList,
|
||||
};
|
||||
}, {
|
||||
persist: {
|
||||
paths: ['currentModelInfo'], // 只持久化 currentModelInfo
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user