Files
x_admin/x_admin_app/utils/perms.ts
2024-06-07 15:45:15 +08:00

13 lines
278 B
TypeScript

import { useUserStore } from "@/stores/user";
export const perms = (perms:string) => {
if (!perms) return true;
const userStore = useUserStore();
const auth = userStore.auth;
let find = auth.find((item) => {
return item.action === perms;
});
return !!find;
};