yuwenjun1997 2 rokov pred
rodič
commit
3c0c0a69c8

+ 9 - 2
src/router/index.js

@@ -67,8 +67,15 @@ export const constantRoutes = [
     hidden: true
   },
   {
-    path: '/test',
-    component: () => import('@/views/test')
+    path: '/redirect',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: '/redirect/:path(.*)',
+        component: () => import('@/views/common/redirect/index')
+      }
+    ]
   },
   {
     path: '/pay',

+ 1 - 1
src/router/module/settings.js

@@ -12,7 +12,7 @@ const settingRoutes = [
       {
         path: 'menus',
         name: 'SettingsMenus',
-        meta: { title: '菜单管理', roles: ['admin'], noCache: true },
+        meta: { title: '菜单管理', roles: ['admin'], noCache: false },
         component: () => import('@/views/admin/settings/menus')
       },
       {

+ 1 - 0
src/views/admin/settings/menus/index.vue

@@ -12,6 +12,7 @@
 <script>
 import TableList from './components/table-list.vue'
 export default {
+  name: 'SettingsMenus',
   components: {
     TableList
   },

+ 12 - 0
src/views/common/redirect/index.vue

@@ -0,0 +1,12 @@
+<script>
+export default {
+  created() {
+    const { params, query } = this.$route
+    const { path } = params
+    this.$router.replace({ path: '/' + path, query })
+  },
+  render: function(h) {
+    return h() // avoid warning message
+  }
+}
+</script>

+ 0 - 17
src/views/test/index.vue

@@ -1,17 +0,0 @@
-<template>
-  <div>
-    <permission-button :permission="['normal']" @click="handleClick">按钮</permission-button>
-  </div>
-</template>
-
-<script>
-import PermissionButton from '@/views/components/PermissionButton'
-export default {
-  components: { PermissionButton },
-  methods: {
-    handleClick() {
-      console.log('handle click')
-    }
-  }
-}
-</script>