|
|
@@ -43,14 +43,11 @@
|
|
|
import Login from '@/components/Login.vue';
|
|
|
import UserInfo from '@/components/UserInfo.vue';
|
|
|
import { useGlobSetting } from '@/hooks/setting';
|
|
|
-
|
|
|
- // import { storeToRefs } from 'pinia';
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
const activeNav = ref(NAV_LIST[0].name);
|
|
|
const router = useRouter();
|
|
|
- // const showLogin = ref(false);
|
|
|
const searchValue = ref('');
|
|
|
const loginType = ref<'login' | 'switchAccount' | 'modifyPassword'>('login');
|
|
|
|
|
|
@@ -66,44 +63,15 @@
|
|
|
const currentRoute = useRoute();
|
|
|
const { title } = useGlobSetting();
|
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
- const handleNavClick = (item: any) => {
|
|
|
-=======
|
|
|
const handleNavClick = (item: { name: string; path: string }) => {
|
|
|
- // 如果不是首页,先检查用户是否登录
|
|
|
- // if (item.name !== '首页' && !userInfo.value) {
|
|
|
- // handleLogin('login');
|
|
|
- // return;
|
|
|
- // }
|
|
|
->>>>>>> 9bcd636 (fix: 完成了未登录情况下顶级路由高亮显示问题)
|
|
|
if (!item.path) return;
|
|
|
activeNav.value = item.name;
|
|
|
router.push(item.path);
|
|
|
};
|
|
|
|
|
|
-<<<<<<< HEAD
|
|
|
-=======
|
|
|
- console.log('currentRoute', currentRoute);
|
|
|
-
|
|
|
->>>>>>> 9bcd636 (fix: 完成了未登录情况下顶级路由高亮显示问题)
|
|
|
const selectedKey = computed(() => {
|
|
|
return currentRoute.matched[0]?.name;
|
|
|
});
|
|
|
-<<<<<<< HEAD
|
|
|
-=======
|
|
|
-
|
|
|
- // 跟随页面路由变化,切换菜单选中状态
|
|
|
- // watch(
|
|
|
- // () => currentRoute.fullPath,
|
|
|
- // () => {
|
|
|
- // updateMenu();
|
|
|
- // const matched = currentRoute.matched;
|
|
|
- // openKeys.value = matched.map((item) => item.name);
|
|
|
- // const activeMenu: string = (currentRoute.meta?.activeMenu as string) || '';
|
|
|
- // selectedKeys.value = activeMenu ? activeMenu : (currentRoute.name as string);
|
|
|
- // },
|
|
|
- // );
|
|
|
->>>>>>> 9bcd636 (fix: 完成了未登录情况下顶级路由高亮显示问题)
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|