feat: 路由守卫调整/
This commit is contained in:
@ -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');
|
||||
|
||||
Reference in New Issue
Block a user