storeinit
This commit is contained in:
parent
327a1c2064
commit
32209bd8a4
25
src/store/AuthStore.ts
Normal file
25
src/store/AuthStore.ts
Normal file
@ -0,0 +1,25 @@
|
||||
interface AuthStoreState {
|
||||
username: string,
|
||||
token: string,
|
||||
}
|
||||
|
||||
const state : AuthStoreState = {
|
||||
username: "",
|
||||
token: "",
|
||||
}
|
||||
|
||||
const getters = {
|
||||
username: (state: AuthStoreState) => state.username,
|
||||
token: (state: AuthStoreState) => state.token,
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
setUsername(state: AuthStoreState, username: string) {
|
||||
state.username = username
|
||||
},
|
||||
setToken(state: AuthStoreState, token: string) {
|
||||
state.token = token
|
||||
},
|
||||
}
|
||||
|
||||
export
|
Loading…
x
Reference in New Issue
Block a user