diff --git a/src/App.vue b/src/App.vue
index 4c81e4b..9ecb801 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,15 +1,16 @@
diff --git a/src/layout/MainContainer.vue b/src/layout/MainContainer.vue
new file mode 100644
index 0000000..d2f5bf3
--- /dev/null
+++ b/src/layout/MainContainer.vue
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
diff --git a/src/router/index.js b/src/router/index.js
index d73877e..5cf5984 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,9 +1,18 @@
import { createRouter, createWebHistory } from 'vue-router';
+// import auth from '@/utils/auth';
const ExampleView = () => import('@/views/ExampleView/ExampleView.vue');
+const LoginView = () => import('@/views/LoginView/LoginView.vue');
const routes = [
+ {
+ path: '/',
+ redirect: () => '/login',
+ },
+
{ path: '/example', name: 'ExampleView', component: ExampleView },
+
+ { path: '/login', name: 'LoginView', component: LoginView },
];
const router = createRouter({
@@ -11,4 +20,17 @@ const router = createRouter({
routes,
});
+// 前置路由钩子
+// router.beforeEach((to, from, next) => {
+// // 必须先登录
+// if (!['LoginView'].includes(to.name) && !auth.checkToken()) {
+// return next({
+// name: 'LoginView',
+// replace: true,
+// });
+// }
+//
+// return next();
+// });
+
export default router;
diff --git a/src/views/LoginView/LoginView.vue b/src/views/LoginView/LoginView.vue
new file mode 100644
index 0000000..166dc65
--- /dev/null
+++ b/src/views/LoginView/LoginView.vue
@@ -0,0 +1,13 @@
+
+
+
+ LoginView
+
+
+