Browse Source

更新 路由逻辑及默认路径

wzh 3 years ago
parent
commit
a69d41fd59
4 changed files with 8 additions and 6 deletions
  1. 2 2
      src/main.js
  2. 4 2
      src/router/index.js
  3. 1 1
      src/store/index.js
  4. 1 1
      src/views/index/Login.vue

+ 2 - 2
src/main.js

@@ -24,9 +24,9 @@ router.beforeEach(async (to, from, next) => {
   if (id) {
     store.commit("changeLogin", true);
     if (0 === to.matched.length) {
-      next("/cargoOwnerManage/cargoOwnerCompanyList");
+      next("/voyage/voyageList");
     } else if (to.path == "/login" || to.path == "/") {
-      next("/cargoOwnerManage/cargoOwnerCompanyList");
+      next("/voyage/voyageList");
     } else {
       next();
     }

+ 4 - 2
src/router/index.js

@@ -4,6 +4,8 @@ import {
   createMemoryHistory,
   createRouter,
 } from "vue-router";
+import Login from "../views/index/Login.vue";
+import VoyageList from "../views/voyage/voyageList.vue";
 
 const router = createRouter({
   history: createWebHashHistory(),
@@ -19,7 +21,7 @@ const router = createRouter({
       meta: {
         title: "登录",
       },
-      component: () => import("../views/index/Login.vue"),
+      component: Login,
     },
     {
       path: "/cargoOwnerManage/cargoOwnerCompanyDetail",
@@ -96,7 +98,7 @@ const router = createRouter({
       meta: {
         title: "航次列表",
       },
-      component: () => import("../views/voyage/voyageList.vue"),
+      component: VoyageList,
     },
     {
       path: "/agencyList",

+ 1 - 1
src/store/index.js

@@ -11,7 +11,7 @@ const store = createStore({
     isLogin: false,
     firstTitle: "",
     secondTitle: "",
-    currentMenuItem: "/cargoOwnerManage/cargoOwnerCompanyList",
+    currentMenuItem: "/voyage/voyageList",
     baseurl,
     uploadUrl,
     wayBillUrl,

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

@@ -113,7 +113,7 @@ export default {
             localStorage.setItem("status", status);
             localStorage.setItem("userType", 2);
             store.commit("changeLogin", true);
-            router.replace({ path: "/cargoOwnerManage/cargoOwnerCompanyList" });
+            router.replace({ path: "/voyage/voyageList" });
           } else {
             ElNotification.error({
               title: "错误",