frontend 兼容
This commit is contained in:
18
ai-chat-web/src/store/modules/prompt/helper.ts
Normal file
18
ai-chat-web/src/store/modules/prompt/helper.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { ss } from '@/utils/storage'
|
||||
|
||||
const LOCAL_NAME = 'promptStore'
|
||||
|
||||
export type PromptList = []
|
||||
|
||||
export interface PromptStore {
|
||||
promptList: PromptList
|
||||
}
|
||||
|
||||
export function getLocalPromptList(): PromptStore {
|
||||
const promptStore: PromptStore | undefined = ss.get(LOCAL_NAME)
|
||||
return promptStore ?? { promptList: [] }
|
||||
}
|
||||
|
||||
export function setLocalPromptList(promptStore: PromptStore): void {
|
||||
ss.set(LOCAL_NAME, promptStore)
|
||||
}
|
||||
Reference in New Issue
Block a user