sa-token/sa-token-demo/sa-token-demo-cross/sa-token-demo-cross-cookie-vue3/src/router/index.js

26 lines
505 B
JavaScript
Raw Normal View History

2023-06-22 09:00:29 +08:00
import { createRouter, createWebHashHistory } from 'vue-router';
/**
* 创建 vue-router 实例
*/
const router = createRouter({
history: createWebHashHistory(),
routes: [
// 首页
{
name: 'index',
path: "/index",
component: () => import('../views/index.vue'),
},
// 访问 / 时自动重定向到 /index
{
path: "/",
redirect: '/index'
}
],
});
// 导出
export default router;