import { useAuthStore } from "@/stores/modules/auth";

/**
 * @description 根据权限获取一些信息
 * */
export const usePermisGet = () => {
  const authStore = useAuthStore();

  const getFirstMenuPath = (menus = authStore.showMenuListGet): string | null => {
    if (!menus || menus.length === 0) return null;
    const [first] = menus;
    if (first.children && first.children.length > 0) return getFirstMenuPath(first.children);
    return first.path;
  };
  return {
    getFirstMenuPath
  };
};
