Browse Source

chore: update

xiaoxian521 2 years ago
parent
commit
d81ab81fb0

+ 0 - 2
src/router/modules/able.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const ableRouter: RouteConfigsTable = {
   path: "/able",
-  component: Layout,
   redirect: "/able/watermark",
   meta: {
     icon: "ubuntu-fill",

+ 0 - 2
src/router/modules/about.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const aboutRouter: RouteConfigsTable = {
   path: "/about",
-  component: Layout,
   redirect: "/about/index",
   meta: {
     // icon: "question-line",

+ 0 - 2
src/router/modules/components.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const componentsRouter: RouteConfigsTable = {
   path: "/components",
-  component: Layout,
   redirect: "/components/video",
   meta: {
     icon: "menu",

+ 0 - 2
src/router/modules/editor.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const editorRouter: RouteConfigsTable = {
   path: "/editor",
-  component: Layout,
   redirect: "/editor/index",
   meta: {
     icon: "edit",

+ 0 - 2
src/router/modules/error.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const errorRouter: RouteConfigsTable = {
   path: "/error",
-  component: Layout,
   redirect: "/error/403",
   meta: {
     icon: "information-line",

+ 0 - 2
src/router/modules/flowchart.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const flowChartRouter: RouteConfigsTable = {
   path: "/flowChart",
-  component: Layout,
   redirect: "/flowChart/index",
   meta: {
     icon: "set-up",

+ 0 - 2
src/router/modules/formdesign.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const formDesignRouter: RouteConfigsTable = {
   path: "/formDesign",
-  component: Layout,
   redirect: "/formDesign/index",
   meta: {
     icon: "terminal-window-line",

+ 0 - 2
src/router/modules/guide.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const guideRouter: RouteConfigsTable = {
   path: "/guide",
-  component: Layout,
   redirect: "/guide/index",
   meta: {
     icon: "guide",

+ 0 - 2
src/router/modules/list.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const ableRouter: RouteConfigsTable = {
   path: "/list",
-  component: Layout,
   redirect: "/list/card",
   meta: {
     icon: "list-check",

+ 0 - 2
src/router/modules/nested.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const nestedRouter: RouteConfigsTable = {
   path: "/nested",
-  component: Layout,
   redirect: "/nested/menu1/menu1-1",
   meta: {
     title: $t("menus.hsmenus"),

+ 0 - 2
src/router/modules/ppt.ts

@@ -1,10 +1,8 @@
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 const IFrame = () => import("/@/layout/frameView.vue");
 
 const pptRouter: RouteConfigsTable = {
   path: "/ppt",
-  component: Layout,
   redirect: "/ppt/index",
   meta: {
     icon: "ppt",

+ 0 - 2
src/router/modules/result.ts

@@ -1,10 +1,8 @@
 import { $t } from "/@/plugins/i18n";
 import type { RouteConfigsTable } from "/#/index";
-const Layout = () => import("/@/layout/index.vue");
 
 const resultRouter: RouteConfigsTable = {
   path: "/result",
-  component: Layout,
   redirect: "/result/success",
   meta: {
     icon: "checkbox-circle-line",

+ 2 - 5
src/router/utils.ts

@@ -13,7 +13,6 @@ import { useTimeoutFn } from "@vueuse/core";
 import { RouteConfigs } from "/@/layout/types";
 import { buildHierarchyTree } from "@pureadmin/utils";
 import { usePermissionStoreHook } from "/@/store/modules/permission";
-const Layout = () => import("/@/layout/index.vue");
 const IFrame = () => import("/@/layout/frameView.vue");
 // https://cn.vitejs.dev/guide/features.html#glob-import
 const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}");
@@ -229,12 +228,10 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
   arrRoutes.forEach((v: RouteRecordRaw) => {
     // 将backstage属性加入meta,标识此路由为后端返回路由
     v.meta.backstage = true;
-    if (v.redirect) {
-      v.component = Layout;
-    } else if (v.meta?.frameSrc) {
+    if (v.meta?.frameSrc) {
       v.component = IFrame;
     } else {
-      // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会path保持一致)
+      // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会path保持一致)
       const index = v?.component
         ? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any))
         : modulesRoutesKeys.findIndex(ev => ev.includes(v.path));