push
This commit is contained in:
25
lib/saas/store/modules/user.ts
Normal file
25
lib/saas/store/modules/user.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { router } from '/nerv-lib/saas/router';
|
||||
|
||||
export const user = defineStore<
|
||||
string,
|
||||
{ token: string; userName: string },
|
||||
{},
|
||||
{ login: Function; logout: Function }
|
||||
>({
|
||||
id: 'user',
|
||||
state: () => {
|
||||
return { token: '', userName: '111' };
|
||||
},
|
||||
getters: {
|
||||
double(): string {
|
||||
return this.userName;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
login() {},
|
||||
logout() {
|
||||
router.push('/login');
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user