feat: 替换mockjs

This commit is contained in:
kailong321200875
2023-11-29 16:14:48 +08:00
parent b8f9a9940d
commit 7c76d945be
9 changed files with 249 additions and 207 deletions

View File

@@ -1,6 +1,5 @@
import config from '@/config/axios/config'
import Mock from 'mockjs'
import { faker } from '@faker-js/faker'
const { code } = config
@@ -22,7 +21,7 @@ export default [
component: '#',
redirect: '/dashboard/analysis',
name: 'Dashboard',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 1,
type: 0,
parentId: undefined,
@@ -37,7 +36,7 @@ export default [
path: 'analysis',
component: 'views/Dashboard/Analysis',
name: 'Analysis',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 2,
type: 1,
parentId: 1,
@@ -62,7 +61,7 @@ export default [
path: 'workplace',
component: 'views/Dashboard/Workplace',
name: 'Workplace',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 3,
type: 1,
parentId: 1,
@@ -96,7 +95,7 @@ export default [
icon: 'clarity:document-solid'
},
name: 'ExternalLink',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 4,
type: 0,
parentId: undefined,
@@ -105,7 +104,7 @@ export default [
{
path: 'https://element-plus-admin-doc.cn/',
name: 'DocumentLink',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 5,
type: 1,
parentId: 4,
@@ -121,7 +120,7 @@ export default [
component: '#',
redirect: '/level/menu1/menu1-1/menu1-1-1',
name: 'Level',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 6,
type: 0,
parentId: undefined,
@@ -135,7 +134,7 @@ export default [
path: 'menu1',
name: 'Menu1',
component: '##',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 7,
type: 0,
parentId: 6,
@@ -149,7 +148,7 @@ export default [
path: 'menu1-1',
name: 'Menu11',
component: '##',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 8,
type: 0,
parentId: 7,
@@ -164,7 +163,7 @@ export default [
path: 'menu1-1-1',
name: 'Menu111',
component: 'views/Level/Menu111',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 9,
type: 1,
parentId: 8,
@@ -179,7 +178,7 @@ export default [
path: 'menu1-2',
name: 'Menu12',
component: 'views/Level/Menu12',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 10,
type: 1,
parentId: 7,
@@ -194,7 +193,7 @@ export default [
path: 'menu2',
name: 'Menu2Demo',
component: 'views/Level/Menu2',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 11,
type: 1,
parentId: 6,
@@ -210,7 +209,7 @@ export default [
component: '#',
redirect: '/example/example-dialog',
name: 'Example',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 12,
type: 0,
parentId: undefined,
@@ -225,7 +224,7 @@ export default [
path: 'example-dialog',
component: 'views/Example/Dialog/ExampleDialog',
name: 'ExampleDialog',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 13,
type: 1,
parentId: 12,
@@ -256,7 +255,7 @@ export default [
path: 'example-page',
component: 'views/Example/Page/ExamplePage',
name: 'ExamplePage',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 14,
type: 1,
parentId: 12,
@@ -287,7 +286,7 @@ export default [
path: 'example-add',
component: 'views/Example/Page/ExampleAdd',
name: 'ExampleAdd',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 15,
type: 1,
parentId: 12,
@@ -305,7 +304,7 @@ export default [
path: 'example-edit',
component: 'views/Example/Page/ExampleEdit',
name: 'ExampleEdit',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 16,
type: 1,
parentId: 12,
@@ -323,7 +322,7 @@ export default [
path: 'example-detail',
component: 'views/Example/Page/ExampleDetail',
name: 'ExampleDetail',
status: Mock.Random.integer(0, 1),
status: faker.number.int({ min: 0, max: 1 }),
id: 17,
type: 1,
parentId: 12,