dhjk/src/store/perms.js

18 lines
350 B
JavaScript

import { defineStore } from "pinia";
import tools from "@/utils/tools";
let user = tools.data.get("user");
let ownPermission = user?.perms || [];
export const usePerms = defineStore("perms", {
state: () => {
return {
perms: [...ownPermission],
};
},
actions: {
changePerms(val) {
this.perms = [...val];
},
},
});