Skip to content

Commit

Permalink
v2.15.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dooy committed Feb 8, 2024
1 parent e73ad96 commit f07f338
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 21 additions & 1 deletion src/store/homeStore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { gptsType, mlog } from '@/api';
import { reactive } from 'vue'
import { ss } from '@/utils/storage'

export const homeStore = reactive({
myData:{
act:'',//动作
Expand Down Expand Up @@ -118,4 +120,22 @@ export const gptServerStore= reactive({
,setInit(){
this.setMyData(getServerDefault());
}
})
})


const gptsUlistInit= ():gptsType[]=>{
const lk= ss.get('gpts-use-list');
if( !lk) return [];
return lk as gptsType[];
}

//使用gtps列表
export const gptsUlistStore= reactive({
myData:gptsUlistInit(),
setMyData( v: gptsType){
this.myData= this.myData.filter( v2=> v2.gid!=v.gid );
this.myData.unshift(v);
ss.set('gpts-use-list', this.myData );
return this;
}
});
4 changes: 3 additions & 1 deletion src/views/mj/aiGptsCom.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { myFetch, gptsType, mlog, chatSetting,my2Fetch } from '@/api';
import { homeStore,gptConfigStore,useChatStore } from '@/store';
import { homeStore,gptConfigStore,useChatStore, gptsUlistStore } from '@/store';
import { ref,computed ,watch } from 'vue';
import { useMessage ,NButton,NImage,NTag,NPopover} from 'naive-ui';
import { SvgIcon } from '@/components/common';
Expand Down Expand Up @@ -46,6 +46,8 @@ const go= async ( item: gptsType)=>{
mlog('go local ', homeStore.myData.local );
if(homeStore.myData.local!=='Chat') router.replace({name:'Chat',params:{uuid:chatStore.active}});
gptsUlistStore.setMyData( item );
}
const pageLoad= async ()=>{
st.value.loadPage= true;
Expand Down

0 comments on commit f07f338

Please sign in to comment.