mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-09-26 20:21:19 +08:00
13 lines
308 B
TypeScript
13 lines
308 B
TypeScript
import { useUserStore } from "@/stores/user";
|
|
|
|
export const perms = (perms:string) => {
|
|
if (!perms) return false;
|
|
const userStore = useUserStore();
|
|
const permissions = userStore.permissions;
|
|
|
|
let find = permissions.find((item) => {
|
|
return item === perms|| item === "*";
|
|
});
|
|
return !!find;
|
|
};
|