Signed-off-by: 吴文峰 <kevin@lmve.net>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useUserStore = defineStore('user', {
|
||||
state: () => ({
|
||||
username: '',
|
||||
token: ''
|
||||
}),
|
||||
actions: {
|
||||
setUser(username, token) {
|
||||
this.username = username
|
||||
this.token = token
|
||||
},
|
||||
logout() {
|
||||
this.username = ''
|
||||
this.token = ''
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user