docs: 没有更改
This commit is contained in:
parent
80af0bd77b
commit
12a2323c18
@ -1,9 +1,9 @@
|
||||
// https://pinia.vuejs.org/zh/
|
||||
// store/index.js
|
||||
import { createPinia } from "pinia";
|
||||
|
||||
// 创建
|
||||
const pinia = createPinia();
|
||||
|
||||
// 导出
|
||||
export default pinia;
|
||||
// https://pinia.vuejs.org/zh/
|
||||
// store/index.js
|
||||
import { createPinia } from "pinia";
|
||||
|
||||
// 创建
|
||||
const pinia = createPinia();
|
||||
|
||||
// 导出
|
||||
export default pinia;
|
||||
|
||||
@ -1,32 +1,32 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
* @methods setAccount 设置账号信息
|
||||
* @methods setToken 设置token
|
||||
* @methods logOut 退出登录
|
||||
*/
|
||||
export const useUserInfoStore = defineStore("routeList", {
|
||||
state: (): any => ({
|
||||
account: {
|
||||
username: "",
|
||||
roles: []
|
||||
}, // 账号信息
|
||||
token: "" // token
|
||||
}),
|
||||
actions: {
|
||||
async setAccount(data: Array<string>) {
|
||||
this.account = data;
|
||||
},
|
||||
async setToken(data: string) {
|
||||
this.token = data;
|
||||
},
|
||||
async logOut() {
|
||||
this.account = {};
|
||||
this.token = "";
|
||||
}
|
||||
},
|
||||
persist: {
|
||||
enabled: true // 开启数据缓存-默认缓存全部数据
|
||||
}
|
||||
});
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
* @methods setAccount 设置账号信息
|
||||
* @methods setToken 设置token
|
||||
* @methods logOut 退出登录
|
||||
*/
|
||||
export const useUserInfoStore = defineStore("routeList", {
|
||||
state: (): any => ({
|
||||
account: {
|
||||
username: "",
|
||||
roles: []
|
||||
}, // 账号信息
|
||||
token: "" // token
|
||||
}),
|
||||
actions: {
|
||||
async setAccount(data: Array<string>) {
|
||||
this.account = data;
|
||||
},
|
||||
async setToken(data: string) {
|
||||
this.token = data;
|
||||
},
|
||||
async logOut() {
|
||||
this.account = {};
|
||||
this.token = "";
|
||||
}
|
||||
},
|
||||
persist: {
|
||||
enabled: true // 开启数据缓存-默认缓存全部数据
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user