11import { defineStore } from 'pinia'
22import { store } from './index'
33import { chatApi , ChatInfo } from '@/api/chat'
4- import { useCache } from '@/utils/useCache'
5-
6- const { wsCache } = useCache ( )
7- const flagKey = 'sqlbit-assistant-flag'
84type Resolver < T = any > = ( value : T | PromiseLike < T > ) => void
95type Rejecter = ( reason ?: any ) => void
106interface PendingRequest < T = any > {
@@ -16,7 +12,6 @@ interface AssistantState {
1612 id : string
1713 token : string
1814 assistant : boolean
19- flag : number
2015 type : number
2116 certificate : string
2217 online : boolean
@@ -35,7 +30,6 @@ export const AssistantStore = defineStore('assistant', {
3530 id : '' ,
3631 token : '' ,
3732 assistant : false ,
38- flag : 0 ,
3933 type : 0 ,
4034 certificate : '' ,
4135 online : false ,
@@ -61,9 +55,6 @@ export const AssistantStore = defineStore('assistant', {
6155 getAssistant ( ) : boolean {
6256 return this . assistant
6357 } ,
64- getFlag ( ) : number {
65- return this . flag
66- } ,
6758 getType ( ) : number {
6859 return this . type
6960 } ,
@@ -176,14 +167,6 @@ export const AssistantStore = defineStore('assistant', {
176167 setAssistant ( assistant : boolean ) {
177168 this . assistant = assistant
178169 } ,
179- setFlag ( flag : number ) {
180- if ( wsCache . get ( flagKey ) ) {
181- this . flag = wsCache . get ( flagKey )
182- } else {
183- this . flag = flag
184- wsCache . set ( flagKey , flag )
185- }
186- } ,
187170 setPageEmbedded ( embedded ?: boolean ) {
188171 this . pageEmbedded = ! ! embedded
189172 } ,
@@ -208,7 +191,6 @@ export const AssistantStore = defineStore('assistant', {
208191 return chat
209192 } ,
210193 clear ( ) {
211- wsCache . delete ( flagKey )
212194 this . $reset ( )
213195 } ,
214196 } ,
0 commit comments