浏览代码

首页地图添加

123 1 年之前
父节点
当前提交
4a1ac614ec
共有 3 个文件被更改,包括 16 次插入15 次删除
  1. 1 0
      src/layouts/index.vue
  2. 14 14
      src/router/index.ts
  3. 1 1
      src/views/login/index.vue

+ 1 - 0
src/layouts/index.vue

@@ -9,6 +9,7 @@
         <template #logo>
           <img src="../assets/logo.png" height="32" alt="logo" />
         </template>
+        <t-menu-item value="homeIndex"> 首页 </t-menu-item>
         <t-menu-item value="runDataIndex"> 运行数据 </t-menu-item>
         <t-menu-item value="logsDataIndex"> 日志数据 </t-menu-item>
         <template #operations>

+ 14 - 14
src/router/index.ts

@@ -10,7 +10,20 @@ const allRoutes: Array<RouteRecordRaw> = [
     },
     {
         path: '/',
-        redirect: '/runData',
+        redirect: '/home',
+    },
+    {
+        path: '/home',
+        component: Layout,
+        redirect: '/home/index',
+        name: 'home',
+        children: [
+            {
+                path: 'index',
+                name: 'homeIndex',
+                component: () => import('@/views/home/index.vue'),
+                meta: { title: '首页' },
+            }]
     },
     {
         path: '/runData',
@@ -37,19 +50,6 @@ const allRoutes: Array<RouteRecordRaw> = [
                 component: () => import('@/views/logs/index.vue'),
                 meta: { title: '日志数据' },
             }]
-    },
-    {
-        path: '/demo',
-        component: Layout,
-        redirect: '/demo/index',
-        name: 'demo',
-        children: [
-            {
-                path: 'index',
-                name: 'demoIndex',
-                component: () => import('@/views/demo/index.vue'),
-                meta: { title: 'demo数据' },
-            }]
     }
 ];
 

+ 1 - 1
src/views/login/index.vue

@@ -87,7 +87,7 @@ const onSubmit = async ({ validateResult }) => {
       const res = await userStore.login(formData);
       if (res.code == 200) {
         MessagePlugin.success('登录成功');
-        router.push('/runData');
+        router.push('/home');
       }
     } catch (e) {
       console.log(e);