feat: 路由守卫调整/

This commit is contained in:
renxiaodong
2025-06-23 03:16:55 -04:00
parent f2ce7a8539
commit 9d7f06ad0b
8 changed files with 60 additions and 62 deletions

View File

@ -3,14 +3,19 @@ import { useAppStore } from '@/stores';
import { IconExport, IconFile, IconCaretDown } from '@arco-design/web-vue/es/icon';
import { fetchMenusTree } from '@/api/all';
import { handleUserLogout } from '@/utils/user';
import { fetchLogOut } from '@/api/all/login';
const lists = ref([]);
const router = useRouter();
const clickExit = () => {
handleUserLogout();
const clickExit = async () => {
const { code } = await fetchLogOut();
if (code === 200) {
handleUserLogout();
}
};
const getMenus = async () => {
const res = await fetchMenusTree();
if (res.code == 200) {
if (res.code === 200) {
lists.value = res.data;
}
};
@ -25,7 +30,7 @@ function setServerMenu() {
}
const handleSelect = (index: any) => {
console.log(index);
if (index == 0) {
if (index === 0) {
router.push('/workplace');
} else {
router.push('/dataEngine/dataEngine/hotTranslation');