| | |
| | | <script setup> |
| | | import { nextTick, ref, inject } from 'vue'; |
| | | import { nextTick, ref, inject, onMounted } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postForm } from '@/utils/request.js' |
| | | import { logout } from '@/config.js'; |
| | |
| | | ...Icons, |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | let name = router.currentRoute.value.name; |
| | | let path = router.currentRoute.value.path; |
| | | if (currentCache.value == null && path != '/') { |
| | | get('/api/menu/get/route', { |
| | | route: path |
| | | }).then((resp) => { |
| | | let result = resp.data; |
| | | let data = result.data; |
| | | if (result.code == 200) { |
| | | currentCache.value = name; |
| | | routerCache.value.push(name) |
| | | routerCacheList.value.push({ |
| | | key: path, |
| | | languageId: data.languageId, |
| | | name: name, |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | getMenu() |
| | | function getMenu() { |
| | | get('/api/auth/menu', {}).then((result) => { |