perf: 还原mock.js

This commit is contained in:
kailong321200875
2023-12-25 17:25:33 +08:00
parent a18bc641e8
commit 83de387e2a
8 changed files with 217 additions and 246 deletions

View File

@@ -1,4 +1,4 @@
import { faker } from '@faker-js/faker'
import Mock from 'mockjs'
import { SUCCESS_CODE } from '@/constants'
const timeout = 1000
@@ -19,7 +19,7 @@ export default [
component: '#',
redirect: '/dashboard/analysis',
name: 'Dashboard',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 1,
type: 0,
parentId: undefined,
@@ -34,7 +34,7 @@ export default [
path: 'analysis',
component: 'views/Dashboard/Analysis',
name: 'Analysis',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 2,
type: 1,
parentId: 1,
@@ -59,7 +59,7 @@ export default [
path: 'workplace',
component: 'views/Dashboard/Workplace',
name: 'Workplace',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 3,
type: 1,
parentId: 1,
@@ -93,7 +93,7 @@ export default [
icon: 'clarity:document-solid'
},
name: 'ExternalLink',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 4,
type: 0,
parentId: undefined,
@@ -102,7 +102,7 @@ export default [
{
path: 'https://element-plus-admin-doc.cn/',
name: 'DocumentLink',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 5,
type: 1,
parentId: 4,
@@ -118,7 +118,7 @@ export default [
component: '#',
redirect: '/level/menu1/menu1-1/menu1-1-1',
name: 'Level',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 6,
type: 0,
parentId: undefined,
@@ -132,7 +132,7 @@ export default [
path: 'menu1',
name: 'Menu1',
component: '##',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 7,
type: 0,
parentId: 6,
@@ -146,7 +146,7 @@ export default [
path: 'menu1-1',
name: 'Menu11',
component: '##',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 8,
type: 0,
parentId: 7,
@@ -161,7 +161,7 @@ export default [
path: 'menu1-1-1',
name: 'Menu111',
component: 'views/Level/Menu111',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 9,
type: 1,
parentId: 8,
@@ -176,7 +176,7 @@ export default [
path: 'menu1-2',
name: 'Menu12',
component: 'views/Level/Menu12',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 10,
type: 1,
parentId: 7,
@@ -191,7 +191,7 @@ export default [
path: 'menu2',
name: 'Menu2Demo',
component: 'views/Level/Menu2',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 11,
type: 1,
parentId: 6,
@@ -207,7 +207,7 @@ export default [
component: '#',
redirect: '/example/example-dialog',
name: 'Example',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 12,
type: 0,
parentId: undefined,
@@ -222,7 +222,7 @@ export default [
path: 'example-dialog',
component: 'views/Example/Dialog/ExampleDialog',
name: 'ExampleDialog',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 13,
type: 1,
parentId: 12,
@@ -253,7 +253,7 @@ export default [
path: 'example-page',
component: 'views/Example/Page/ExamplePage',
name: 'ExamplePage',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 14,
type: 1,
parentId: 12,
@@ -284,7 +284,7 @@ export default [
path: 'example-add',
component: 'views/Example/Page/ExampleAdd',
name: 'ExampleAdd',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 15,
type: 1,
parentId: 12,
@@ -302,7 +302,7 @@ export default [
path: 'example-edit',
component: 'views/Example/Page/ExampleEdit',
name: 'ExampleEdit',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 16,
type: 1,
parentId: 12,
@@ -320,7 +320,7 @@ export default [
path: 'example-detail',
component: 'views/Example/Page/ExampleDetail',
name: 'ExampleDetail',
status: faker.number.int({ min: 0, max: 1 }),
status: Mock.Random.integer(0, 1),
id: 17,
type: 1,
parentId: 12,