diff --git a/mock/route.js b/mock/route.js index d36c6fcc..38cd2e97 100644 --- a/mock/route.js +++ b/mock/route.js @@ -33,5 +33,15 @@ export default [ data: asyncRoutesMap } } + }, + { + url: '/routes', + type: 'put', + response: _ => { + return { + code: 20000, + data: {} + } + } } ] diff --git a/src/api/route.js b/src/api/route.js index 8cd35e69..9891b64d 100644 --- a/src/api/route.js +++ b/src/api/route.js @@ -6,3 +6,11 @@ export function getRoutes() { method: 'get' }) } + +export function importRoutes(data) { + return request({ + url: '/routes', + method: 'put', + data + }) +} diff --git a/src/router/index.js b/src/router/index.js index fbe8ad25..559de4fd 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -167,6 +167,15 @@ export const asyncRoutes = [ title: 'Role Permission', roles: ['admin'] } + }, + { + path: 'path', + component: () => import('@/views/permission/route'), + name: 'Route', + meta: { + title: 'Route', + roles: ['admin'] + } } ] }, diff --git a/src/views/permission/route.vue b/src/views/permission/route.vue new file mode 100644 index 00000000..8909b6f0 --- /dev/null +++ b/src/views/permission/route.vue @@ -0,0 +1,49 @@ + + + Import Routes + + + + + {{ scope.row[key] }} + + + + + + + +