routing
This commit is contained in:
@@ -3,6 +3,7 @@ import { currentLang, langs } from './langs'
|
||||
import { getSettings } from './settings'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import Default from '@/layouts/default.vue'
|
||||
import { getMenu } from './menu'
|
||||
|
||||
|
||||
function isAuthenticated(): boolean {
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
import { useFetchJson } from "@/composable/useFetchJson";
|
||||
import type { MenuItem, Route } from "@/types/menu";
|
||||
|
||||
export const getMenu = async () => {
|
||||
const resp = await useFetchJson('/api/v1/restricted/menu/get-menu');
|
||||
const resp = await useFetchJson<MenuItem>('/api/v1/restricted/menu/get-menu');
|
||||
|
||||
return resp.items.children
|
||||
|
||||
}
|
||||
|
||||
|
||||
export const getRoutes = async () => {
|
||||
const resp = await useFetchJson<Route[]>('/api/v1/restricted/menu/get-routes');
|
||||
|
||||
return resp.items
|
||||
|
||||
|
||||
Reference in New Issue
Block a user