123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- import { config } from '@/config/axios/config'
- import { MockMethod } from 'vite-plugin-mock'
- const { result_code } = config
- const timeout = 0
- const adminList = [
- {
- path: '/dashboard',
- component: '#',
- redirect: '/dashboard/analysis',
- name: 'Dashboard',
- meta: {
- title: '首页',
- icon: 'ant-design:dashboard-filled',
- alwaysShow: true
- },
- children: [
- {
- path: 'analysis',
- component: 'views/Dashboard/Analysis',
- name: 'Analysis',
- meta: {
- title: 'router.analysis',
- noCache: true
- }
- },
- {
- path: 'workplace',
- component: 'views/Dashboard/Workplace',
- name: 'Workplace',
- meta: {
- title: 'router.workplace',
- noCache: true
- }
- }
- ]
- },
- {
- path: '/example',
- component: '#',
- redirect: '/example/example-page',
- name: 'Example',
- meta: {
- title: '示例',
- icon: 'ep:management',
- alwaysShow: true
- },
- children: [
- {
- path: 'example-page',
- component: 'views/Example/Page/ExamplePage',
- name: 'ExamplePage',
- meta: {
- title: 'router.examplePage'
- }
- },
- {
- path: 'example-add',
- component: 'views/Example/Page/ExampleAdd',
- name: 'ExampleAdd',
- meta: {
- title: 'router.exampleAdd',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/example/example-page'
- }
- },
- {
- path: 'example-edit',
- component: 'views/Example/Page/ExampleEdit',
- name: 'ExampleEdit',
- meta: {
- title: 'router.exampleEdit',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/example/example-page'
- }
- },
- {
- path: 'example-detail',
- component: 'views/Example/Page/ExampleDetail',
- name: 'ExampleDetail',
- meta: {
- title: 'router.exampleDetail',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/example/example-page'
- }
- }
- ]
- },
- {
- path: '/manage',
- component: '#',
- redirect: '/manage/news',
- name: 'Manage',
- meta: {
- title: '模块管理',
- icon: 'ep:menu',
- alwaysShow: true
- },
- children: [
- {
- path: 'news-page',
- component: 'views/Manage/News/NewsPage',
- name: 'NewsPage',
- meta: {
- title: '新闻管理'
- }
- },
- {
- path: 'news-add',
- component: 'views/Manage/News/NewsAdd',
- name: 'NewsAdd',
- meta: {
- title: '新闻新增',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/manage/news-page'
- }
- },
- {
- path: 'news-edit',
- component: 'views/Manage/News/NewsEdit',
- name: 'NewsEdit',
- meta: {
- title: '新闻编辑',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/manage/news-page'
- }
- },
- {
- path: 'news-detail',
- component: 'views/Manage/News/NewsDetail',
- name: 'NewsDetail',
- meta: {
- title: '新闻详情',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/manage/news-page'
- }
- },
- {
- path: 'product-page',
- component: 'views/Manage/Product/ProductPage',
- name: 'ProductPage',
- meta: {
- title: '产品管理',
- activeMenu: '/manage/product-page'
- }
- },
- {
- path: 'product-add',
- component: 'views/Manage/Product/ProductAdd',
- name: 'ProductAdd',
- meta: {
- title: '产品新增',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/manage/product-page'
- }
- },
- {
- path: 'product-edit',
- component: 'views/Manage/Product/ProductEdit',
- name: 'ProductEdit',
- meta: {
- title: '产品编辑',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/manage/product-page'
- }
- },
- {
- path: 'product-detail',
- component: 'views/Manage/Product/ProductDetail',
- name: 'ProductDetail',
- meta: {
- title: '产品详情',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/manage/product-page'
- }
- },
- ]
- },
- {
- path: '/setting',
- component: '#',
- redirect: '/setting/menu',
- name: 'Setting',
- meta: {
- title: '系统设置',
- icon: 'ep:setting',
- alwaysShow: true
- },
- children: [
- {
- path: 'menu-page',
- component: 'views/Setting/Menu/MenuPage',
- name: 'MenuPage',
- meta: {
- title: '菜单管理'
- }
- },
- {
- path: 'menu-add',
- component: 'views/Setting/Menu/MenuAdd',
- name: 'MenuAdd',
- meta: {
- title: '菜单新增',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/setting/menu-page'
- }
- },
- {
- path: 'menu-edit',
- component: 'views/Setting/Menu/MenuEdit',
- name: 'MenuEdit',
- meta: {
- title: '菜单编辑',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/setting/menu-page'
- }
- },
- {
- path: 'menu-detail',
- component: 'views/Setting/Menu/MenuDetail',
- name: 'MenuDetail',
- meta: {
- title: '菜单详情',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/setting/menu-page'
- }
- },
- {
- path: 'user-page',
- component: 'views/Setting/User/UserPage',
- name: 'UserPage',
- meta: {
- title: '用户管理',
- activeMenu: '/setting/user-page'
- }
- },
- {
- path: 'user-add',
- component: 'views/Setting/User/UserAdd',
- name: 'UserAdd',
- meta: {
- title: '用户新增',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/setting/user-page'
- }
- },
- {
- path: 'user-edit',
- component: 'views/Setting/User/UserEdit',
- name: 'UserEdit',
- meta: {
- title: '用户编辑',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/setting/user-page'
- }
- },
- {
- path: 'user-detail',
- component: 'views/Setting/User/UserDetail',
- name: 'UserDetail',
- meta: {
- title: '用户详情',
- noTagsView: true,
- noCache: true,
- hidden: true,
- canTo: true,
- activeMenu: '/setting/user-page'
- }
- },
- ]
- }
- ]
- const testList: string[] = [
- '/dashboard',
- '/dashboard/analysis',
- '/dashboard/workplace',
- 'external-link',
- 'https://element-plus-admin-doc.cn/',
- '/guide',
- '/guide/index',
- '/components',
- '/components/form',
- '/components/form/default-form',
- '/components/form/use-form',
- '/components/form/ref-form',
- '/components/table',
- '/components/table/default-table',
- '/components/table/use-table',
- '/components/table/ref-table',
- '/components/editor-demo',
- '/components/editor-demo/editor',
- '/components/search',
- '/components/descriptions',
- '/components/image-viewer',
- '/components/dialog',
- '/components/icon',
- '/components/echart',
- '/components/count-to',
- '/components/qrcode',
- '/components/highlight',
- '/components/infotip',
- '/Components/InputPassword',
- '/Components/Sticky',
- '/hooks',
- '/hooks/useWatermark',
- '/hooks/useCrudSchemas',
- '/level',
- '/level/menu1',
- '/level/menu1/menu1-1',
- '/level/menu1/menu1-1/menu1-1-1',
- '/level/menu1/menu1-2',
- '/level/menu2',
- '/example',
- '/example/example-dialog',
- '/example/example-page',
- '/example/example-add',
- '/example/example-edit',
- '/example/example-detail',
- '/error',
- '/error/404-demo',
- '/error/403-demo',
- '/error/500-demo'
- ]
- export default [
- // 列表接口
- {
- url: '/role/list',
- method: 'get',
- timeout,
- response: ({ query }) => {
- const { roleName } = query
- return {
- code: result_code,
- data: roleName === 'admin' ? adminList : testList
- }
- }
- }
- ] as MockMethod[]
|