一、前端设置免登录
1、创建页面
<template>
<div style="height: 500px;width: 500px;font-size: 100px">
我的页面
</div>
</template>
<script lang="ts" setup>
</script>
2、设置路由
export const LoginIndexRoute: AppRouteRecordRaw = {
path: '/MyIndex',
name: 'MyIndex',
component: () => import('/@/views/sys/login/MyIndex.vue'),
meta: {
title: t('我的页面'),
},
};
3、设置白名单
MY_INDEX = '/MyIndex',
4、设置白名单生效
const MY_INDEX = PageEnum.MY_INDEX;
const whitePathList: PageEnum[] = [LOGIN_PATH, OAUTH2_LOGIN_PAGE_PATH,MY_INDEX];