mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 17:26:55 +08:00
32 lines
519 B
TypeScript
32 lines
519 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { store } from './index'
|
|
|
|
interface AssistantState {
|
|
token: string
|
|
}
|
|
|
|
export const AssistantStore = defineStore('assistant', {
|
|
state: (): AssistantState => {
|
|
return {
|
|
token: '',
|
|
}
|
|
},
|
|
getters: {
|
|
getToken(): string {
|
|
return this.token
|
|
},
|
|
},
|
|
actions: {
|
|
setToken(token: string) {
|
|
this.token = token
|
|
},
|
|
clear() {
|
|
this.$reset()
|
|
},
|
|
},
|
|
})
|
|
|
|
export const useAssistantStore = () => {
|
|
return AssistantStore(store)
|
|
}
|