mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-09-27 04:26:24 +08:00
13 lines
278 B
TypeScript
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;
|
|
};
|